freebsd-skq/sys/contrib
Robert Watson 8c0fec805f 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
..
altq/altq After cleaning up rt_tables from vnet.h and cleaning up opt_route.h 2009-06-23 17:03:45 +00:00
dev Rewrite OsdSynch.c to reflect the latest ACPICA more closely: 2009-06-08 20:07:16 +00:00
ia64/libuwx Apply local modifications to make Unwind Express BETA 10 buildable and 2006-07-07 23:56:34 +00:00
ipfilter/netinet Add hierarchical jails. A jail may further virtualize its environment 2009-05-27 14:11:23 +00:00
ngatm This commit was generated by cvs2svn to compensate for changes in r171364, 2007-07-11 14:41:54 +00:00
pf After cleaning up rt_tables from vnet.h and cleaning up opt_route.h 2009-06-23 17:03:45 +00:00
rdma Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00