git: udp: Save original protocol processing port for later synchronizing.

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Wed Oct 28 18:33:28 PDT 2015


commit 9ca1e337e73f0ab6f5dfd46527c1cd25996fe59b
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Fri Oct 23 21:37:46 2015 +0800

    udp: Save original protocol processing port for later synchronizing.
    
    Unlike TCP, user could send data w/ address to a UDP socket that
    connect(2) is being called (those data messages will be on the
    original protocol processing port and forwarded to the new protocol
    processing port later), and then close the UDP socket (the detach
    message could be sent to the new protocol processing port before
    the inflight data messages).  The inflight data messages will cause
    later panic, since the socket/inp has been destroyed by the detach
    message.  I will have to say this probably will never happen for any
    real world applications.
    
    We fix this by recording the original message port, and synchronize
    inflight data messages on it upon detaching.  If the connect(2) moves
    between protocol processing ports more than once, we will go though
    all UDP processing netisrs to synchronize all possible inflight data
    messages.

Summary of changes:
 sys/netinet/udp_usrreq.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++-
 sys/sys/socketvar.h      |  2 ++
 2 files changed, 52 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9ca1e337e73f0ab6f5dfd46527c1cd25996fe59b


-- 
DragonFly BSD source repository



More information about the Commits mailing list