Module Name: src Committed By: ozaki-r Date: Fri Jul 1 05:22:33 UTC 2016
Modified Files: src/sys/net: if.c route.c src/sys/netinet: if_arp.c src/sys/netinet6: nd6_nbr.c Log Message: Make sure to free all interface addresses in if_detach Addresses of an interface (struct ifaddr) have a (reverse) pointer of an interface object (ifa->ifa_ifp). If the addresses are surely freed when their interface is destroyed, the pointer is always valid and we don't need a tweak of replacing the pointer to if_index like mbuf. In order to make sure the assumption, the following changes are required: - Deactivate the interface at the firstish of if_detach. This prevents in6_unlink_ifa from saving multicast addresses (wrongly) - Invalidate rtcache(s) and clear a rtentry referencing an address on RTM_DELETE. rtcache(s) may delay freeing an address - Replace callout_stop with callout_halt of DAD timers to ensure stopping such timers in if_detach To generate a diff of this commit: cvs rdiff -u -r1.349 -r1.350 src/sys/net/if.c cvs rdiff -u -r1.167 -r1.168 src/sys/net/route.c cvs rdiff -u -r1.214 -r1.215 src/sys/netinet/if_arp.c cvs rdiff -u -r1.121 -r1.122 src/sys/netinet6/nd6_nbr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.