git: inpcb: Reorder kmalloc and inp checking in set{peer, sock}addr().

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Tue Oct 20 00:20:06 PDT 2015


commit b15c47143c7c434b60c41e71eec5022043fb92b7
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Mon Oct 19 21:36:27 2015 +0800

    inpcb: Reorder kmalloc and inp checking in set{peer,sock}addr().
    
    Since kmalloc(M_WAITOK) happens in the owner protocol thread of
    inp, we don't care about possible kmalloc block.  This makes the
    code more straightforward.
    
    While I'm here:
    - Staticize {in,in6}_setsockaddr().
    - Remove unnecessary critical sections.
    - Fix staled comment about NULL PCB for set{peer,sock}addr().

Summary of changes:
 sys/netinet/in_pcb.c   | 50 +++++++++++++------------------------
 sys/netinet/in_pcb.h   |  1 -
 sys/netinet6/in6_pcb.c | 68 +++++++++++++++++++-------------------------------
 sys/netinet6/in6_pcb.h |  1 -
 4 files changed, 43 insertions(+), 77 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b15c47143c7c434b60c41e71eec5022043fb92b7


-- 
DragonFly BSD source repository



More information about the Commits mailing list