diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-01-18 06:48:26 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-01-18 06:48:26 +0000 |
commit | 6dfa5a01a7f1ba39a2993de6f85f61f615c02890 (patch) | |
tree | e4491826f5fd2d1e316b5a71a08ab8e3932ba46a /sys/netinet6/in6_ifattach.c | |
parent | 6d8f15d6705a2d2c579093c9f4be3aade870e7c4 (diff) |
do not remove default route by mistake, on interface removal.
Diffstat (limited to 'sys/netinet6/in6_ifattach.c')
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 011ca6b9b61..09e48542cf4 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.13 2000/10/25 22:01:02 jason Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.14 2001/01/18 06:48:25 itojun Exp $ */ /* $KAME: in6_ifattach.c,v 1.68 2000/10/18 18:44:24 itojun Exp $ */ /* @@ -889,7 +889,8 @@ in6_ifdetach(ifp) sin6.sin6_family = AF_INET6; sin6.sin6_addr = in6addr_linklocal_allnodes; sin6.sin6_addr.s6_addr16[1] = htons(ifp->if_index); - if ((rt = rtalloc1((struct sockaddr *)&sin6, 0)) != NULL) { + rt = rtalloc1((struct sockaddr *)&sin6, 0); + if (rt && rt->rt_ifp == ifp) { rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0); rtfree(rt); |