summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
committerume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
commit832f8d224926758a9ae0b23a6b45353e44fbc87a (patch)
treea79fc7ad2b97862c4a404f352f0211ad93a7b5f1 /sys/net/if.c
parent2693854b01a52b0395a91322aa3edf926bddff38 (diff)
downloadFreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.zip
FreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.tar.gz
Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index f98d85e..f52d74d 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -269,7 +269,7 @@ if_detach(ifp)
#endif /* INET */
#ifdef INET6
if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET6) {
- in6_purgeaddr(ifa, ifp);
+ in6_purgeaddr(ifa);
/* ifp_addrhead is already updated */
continue;
}
@@ -278,6 +278,16 @@ if_detach(ifp)
IFAFREE(ifa);
}
+#ifdef INET6
+ /*
+ * Remove all IPv6 kernel structs related to ifp. This should be done
+ * before removing routing entries below, since IPv6 interface direct
+ * routes are expected to be removed by the IPv6-specific kernel API.
+ * Otherwise, the kernel will detect some inconsistency and bark it.
+ */
+ in6_ifdetach(ifp);
+#endif
+
/*
* Delete all remaining routes using this interface
* Unfortuneatly the only way to do this is to slog through
@@ -290,11 +300,6 @@ if_detach(ifp)
(void) rnh->rnh_walktree(rnh, if_rtdel, ifp);
}
-#ifdef INET6
- /* nuke all IPv6 kernel structs related to ifp */
- in6_ifdetach(ifp);
-#endif
-
TAILQ_REMOVE(&ifnet, ifp, if_link);
mtx_destroy(&ifp->if_snd.ifq_mtx);
splx(s);
@@ -897,6 +902,7 @@ ifioctl(so, cmd, data, p)
#ifdef INET6
case SIOCSIFPHYADDR_IN6:
#endif
+ case SIOCSLIFPHYADDR:
case SIOCSIFMEDIA:
case SIOCSIFGENERIC:
error = suser(p);
@@ -913,6 +919,9 @@ ifioctl(so, cmd, data, p)
ifs = (struct ifstat *)data;
ifs->ascii[0] = '\0';
+ case SIOCGIFPSRCADDR:
+ case SIOCGIFPDSTADDR:
+ case SIOCGLIFPHYADDR:
case SIOCGIFMEDIA:
case SIOCGIFGENERIC:
if (ifp->if_ioctl == 0)
OpenPOWER on IntegriCloud