git: kernel - Fix auto port assignment collision in network code

Matthew Dillon dillon at crater.dragonflybsd.org
Tue Nov 5 08:13:35 PST 2024


commit 84646c2989fb6978ded9d3ce41be1628389b376a
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Tue Nov 5 08:05:14 2024 -0800

    kernel - Fix auto port assignment collision in network code
    
    * When the SO_REUSEADDR or SO_REUSEPORT socket option is set on a
      socket undergoing automatic lport assignment, the auto network port
      assignment code in the kernel improperly ignores collisions against
      ports assigned to wildcard sockets and may assign the same port.  This
      causes later connect() calls to fail.
    
    * Can cause gdb services to sometimes fail to connect.
    
    * Fixed by ignoring the options for the purposes of finding an unused
      port.
    
    Reported-by: Sergey Zigachev (servik)

Summary of changes:
 sys/netinet/in_pcb.c   |  7 +++++++
 sys/netinet6/in6_src.c | 10 ++++++++++
 2 files changed, 17 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/84646c2989fb6978ded9d3ce41be1628389b376a


-- 
DragonFly BSD source repository


More information about the Commits mailing list