- Factor out if_purgeaddrs_nolink(), which frees all non-link ifaddrs no
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 31 Dec 2007 04:58:54 +0000 (04:58 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 31 Dec 2007 04:58:54 +0000 (04:58 +0000)
commitc727e14292773bb9f58080bc07054e79b1da68b9
tree4db9551d09b6900715c471bf7295fb3e66d4f1da
parent0a9108eba54ab456250ebc007966d4147edb301f
- Factor out if_purgeaddrs_nolink(), which frees all non-link ifaddrs no
  ifnet.if_addrhead
- Use above function in if_detach() and free link ifaddr manually, add some
  assertion there to make sure ifnet.if_addrhead is in sane state

Submitted-by: pavalos@
Obtained-from: FreeBSD (w/ modification)

For tap(4)
- Use if_purgeaddrs_nolink() to clean up tap's if_addrhead
- Cleaning up ifaddrs has nothing to do with current tap's mode (vmnet/tap)
- In non-vmnet mode, clear IFF_RUNNING if_flags when a tap is brought down

For tun(4)
- Use if_purgeaddrs_nolink() to clean up tun's if_addrhead
- Cleaning up ifaddrs has nothing to do with IFF_RUNNING
- in_control() is clever enough to set the RTF_HOST flags for tun, so tun
  does not need to record that dst addr has been set.  Since net/tun/if_tunvar.h
  was exposed to /usr/include "accidentally", instead of nuking TUN_DSTADDR,
  I just mark it as "unused" in comment.
sys/net/if.c
sys/net/if_var.h
sys/net/tap/if_tap.c
sys/net/tun/if_tun.c
sys/net/tun/if_tunvar.h