git: udp: Fix bind races due to async close and random socket inital msgport

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Sun Nov 15 06:33:04 PST 2015


commit 296c350d3c63a181744b80a4b7973dac5fc162a3
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Sun Nov 15 22:02:55 2015 +0800

    udp: Fix bind races due to async close and random socket inital msgport
    
    Bind for UDP sockets is now serialized by local port based netisr.  And
    on detach path, the UDP inpcb is removed from local port hash before
    other netisrs are synchronized, so that the local port for the detaching
    UDP inpcb could be recycled timely.

Summary of changes:
 sys/netinet/in_pcb.c     | 51 +++++++++++++++++++-------------
 sys/netinet/in_pcb.h     |  1 +
 sys/netinet/udp_usrreq.c | 76 +++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 103 insertions(+), 25 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/296c350d3c63a181744b80a4b7973dac5fc162a3


-- 
DragonFly BSD source repository


More information about the Commits mailing list