ND6 / SIOCGNBRINFO_IN6 is the only subsystem using this struct.

Memory is allocated with the net lock held (incl. asserts) through
if_attach() -> if_attachsetup() -> if_attachdomain()
-> dom_ifattach/in6_domifattach()

Conversly, deallocation happens through
if_deattach() -> ... -> in6_domifattach()

ND6 then reads/writes this data through ND_IFINFO(), all occurences in
netinet6/nd6{,_nbr}.c are protected by the net lock (incl. asserts).

Same goes for the ones in netinet/tcp_input.c through ND6_HINT().

Comment copied from if_attachdomain() and fitted < 80 chars.

Feedback? Objection? OK?


diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index b5ebe479b73..bddccd2443a 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -186,7 +186,7 @@ struct ifnet {                              /* and the 
entries */
 
        struct sockaddr_dl *if_sadl;    /* [N] pointer to our sockaddr_dl */
 
-       void    *if_afdata[AF_MAX];
+       void    *if_afdata[AF_MAX];     /* [N] AF dependent data region */
 };
 #define        if_mtu          if_data.ifi_mtu
 #define        if_type         if_data.ifi_type

Reply via email to