diff options
author | ume <ume@FreeBSD.org> | 2001-08-04 17:10:14 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2001-08-04 17:10:14 +0000 |
commit | 215c0c107efbdc79c1fc7eb07321d5285fc338d2 (patch) | |
tree | 7b7ce4133ecd9652e3448fa7d662f6e27859de96 /sys/netinet/in.c | |
parent | edba6eee5eb38b18947df183e9a90212979525ed (diff) | |
download | FreeBSD-src-215c0c107efbdc79c1fc7eb07321d5285fc338d2.zip FreeBSD-src-215c0c107efbdc79c1fc7eb07321d5285fc338d2.tar.gz |
When running aplication joined multicast address,
removing network card, and kill aplication.
imo_membership[].inm_ifp refer interface pointer
after removing interface.
When kill aplication, release socket,and imo_membership.
imo_membership use already not exist interface pointer.
Then, kernel panic.
PR: 29345
Submitted by: Inoue Yuichi <inoue@nd.net.fujitsu.co.jp>
Obtained from: KAME
MFC after: 3 days
Diffstat (limited to 'sys/netinet/in.c')
-rw-r--r-- | sys/netinet/in.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 170a343..7242545 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -48,6 +48,7 @@ #include <netinet/in.h> #include <netinet/in_var.h> +#include <netinet/in_pcb.h> #include <netinet/igmp_var.h> @@ -68,6 +69,9 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW, struct in_multihead in_multihead; /* XXX BSS initialization */ +extern struct inpcbinfo ripcbinfo; +extern struct inpcbinfo udbinfo; + /* * Return 1 if an internet address is for a ``local'' host * (one to which we have a connection). If subnetsarelocal @@ -402,6 +406,14 @@ in_control(so, cmd, data, ifp, p) * a routing process they will come back. */ in_ifadown(&ia->ia_ifa, 1); + /* + * XXX horrible hack to detect that we are being called + * from if_detach() + */ + if (!ifnet_addrs[ifp->if_index - 1]) { + in_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp); + in_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp); + } /* * Protect from ipintr() traversing address list |