git: kernel - Fix ifnet scan race in ipv6

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Sep 26 10:28:08 PDT 2013


commit 8e13abe7b6ff0052c108f98a88b0a1f7d7dc5a07
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Sep 26 10:16:04 2013 -0700

    kernel - Fix ifnet scan race in ipv6
    
    * Fix situations where an ifnet scan can catch an interface as it is still
      being initialized, before ifp->if_afdata[AF_INET6] is assigned.
    
    * Add a global ifnet_token to protect if_index and the ifnet list.
    
      WARNING, there are still SMP races in the ifnet scans, they have
      not yet been instrumented with the new token.
    
    * Also reorder the TAILQ_INSERT of a new if into the ifnet list to occur
      after all the domain initialization has been done rather than before.

Summary of changes:
 sys/kern/lwkt_token.c       |  1 +
 sys/net/if.c                | 14 +++++++++-----
 sys/netinet6/in6.c          | 19 +++++++++++--------
 sys/netinet6/in6_ifattach.c |  2 ++
 sys/netinet6/in6_var.h      |  7 ++++---
 sys/netinet6/nd6.c          |  2 ++
 sys/netinet6/scope6.c       | 14 ++++++++++++--
 sys/sys/thread.h            |  1 +
 8 files changed, 42 insertions(+), 18 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8e13abe7b6ff0052c108f98a88b0a1f7d7dc5a07


-- 
DragonFly BSD source repository


More information about the Commits mailing list