freebsd-skq/sys/netinet6
rwatson c9ef486fe1 Modify most routines returning 'struct ifaddr *' to return references
rather than pointers, requiring callers to properly dispose of those
references.  The following routines now return references:

  ifaddr_byindex
  ifa_ifwithaddr
  ifa_ifwithbroadaddr
  ifa_ifwithdstaddr
  ifa_ifwithnet
  ifaof_ifpforaddr
  ifa_ifwithroute
  ifa_ifwithroute_fib
  rt_getifa
  rt_getifa_fib
  IFP_TO_IA
  ip_rtaddr
  in6_ifawithifp
  in6ifa_ifpforlinklocal
  in6ifa_ifpwithaddr
  in6_ifadd
  carp_iamatch6
  ip6_getdstifaddr

Remove unused macro which didn't have required referencing:

  IFP_TO_IA6

This closes many small races in which changes to interface
or address lists while an ifaddr was in use could lead to use of freed
memory (etc).  In a few cases, add missing if_addr_list locking
required to safely acquire references.

Because of a lack of deep copying support, we accept a race in which
an in6_ifaddr pointed to by mbuf tags and extracted with
ip6_getdstifaddr() doesn't hold a reference while in transmit.  Once
we have mbuf tag deep copy support, this can be fixed.

Reviewed by:	bz
Obtained from:	Apple, Inc. (portions)
MFC after:	6 weeks (portions)
2009-06-23 20:19:09 +00:00
..
dest6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
frag6.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
icmp6.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
icmp6.h
in6_cksum.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_gif.c Fix and add a workaround on an issue of EtherIP packet with reversed 2009-06-07 23:00:40 +00:00
in6_gif.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_ifattach.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
in6_ifattach.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_mcast.c After r193232 rt_tables in vnet.h are no longer indirectly dependent on 2009-06-08 19:57:35 +00:00
in6_pcb.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
in6_pcb.h Merge in6_pcbfree() into in_pcbfree() which after the previous 2008-11-27 12:04:35 +00:00
in6_proto.c Add explicit includes for jail.h to the files that need them and 2009-06-17 15:01:01 +00:00
in6_rmx.c In r194702 I meant to remove vnet.h which is no longer needed, not route.h. 2009-06-23 14:54:42 +00:00
in6_src.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
in6_var.h Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
in6.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
in6.h - Rename IP_NONLOCALOK IP socket option to IP_BINDANY, to be more consistent 2009-06-01 10:30:00 +00:00
ip6_ecn.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_forward.c Try to remove/assimilate as much of formerly IPv4/6 specific 2009-02-08 09:27:07 +00:00
ip6_id.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_input.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
ip6_ipsec.c Add sysctls to toggle the behaviour of the (former) IPSEC_FILTERTUNNEL 2009-05-23 16:42:38 +00:00
ip6_ipsec.h #if 0 out a currently unsued (and incomplete) function: ip6_ipsec_mtu(). 2008-03-14 11:44:30 +00:00
ip6_mroute.c After cleaning up rt_tables from vnet.h and cleaning up opt_route.h 2009-06-23 17:03:45 +00:00
ip6_mroute.h Switch cmd argument to u_long. This matches what if_ethersubr.c does and 2009-06-21 10:29:31 +00:00
ip6_output.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
ip6_var.h Introduce an infrastructure for dismantling vnet instances. 2009-06-08 17:15:40 +00:00
ip6.h
ip6protosw.h Introduce an infrastructure for dismantling vnet instances. 2009-06-08 17:15:40 +00:00
mld6_var.h Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
mld6.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
mld6.h Add MLDv2 protocol header, but do not connect it to the build. 2009-04-29 11:31:23 +00:00
nd6_nbr.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
nd6_rtr.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
nd6.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
nd6.h Introduce an infrastructure for dismantling vnet instances. 2009-06-08 17:15:40 +00:00
pim6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
pim6.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
raw_ip6.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
raw_ip6.h Second round of putting global variables, which were virtualized 2008-12-13 19:13:03 +00:00
route6.c Implement RFC 5095 more fully. Rather than marking this no-op code as 2009-05-09 18:25:58 +00:00
scope6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
scope6.c After cleaning up rt_tables from vnet.h and cleaning up opt_route.h 2009-06-23 17:03:45 +00:00
sctp6_usrreq.c - Cleanup checksum code. 2009-02-03 11:04:03 +00:00
sctp6_var.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
tcp6_var.h Put a global variables, which were virtualized but formerly 2008-12-11 16:26:38 +00:00
udp6_usrreq.c Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
udp6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
vinet6.h Reimplement the netisr framework in order to support parallel netisr 2009-06-01 10:41:38 +00:00