summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2000-11-11 00:11:15 +0000
committeritojun <itojun@openbsd.org>2000-11-11 00:11:15 +0000
commitf6205a66d88cac4dada379828a2208499c3812ff (patch)
tree36386ba4866fe7acc41200ca21ddd19220fa7988
parentUpdate relevant web pages and distrib notes to reflect support for Adaptec (diff)
downloadwireguard-openbsd-f6205a66d88cac4dada379828a2208499c3812ff.tar.xz
wireguard-openbsd-f6205a66d88cac4dada379828a2208499c3812ff.zip
do not panic on "ifconfig lo0 inet6 fe80::1 -alias". KAME PR 295.
(NOTE: only root can do it)
-rw-r--r--sys/netinet6/in6.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index ddf14e82340..75d9be2769f 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: in6.c,v 1.21 2000/10/06 05:52:01 itojun Exp $ */
-/* $KAME: in6.c,v 1.107 2000/10/06 04:58:30 itojun Exp $ */
+/* $OpenBSD: in6.c,v 1.22 2000/11/11 00:11:15 itojun Exp $ */
+/* $KAME: in6.c,v 1.109 2000/10/24 07:19:01 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1126,7 +1126,14 @@ in6_ifscrub(ifp, ia)
{
if ((ia->ia_flags & IFA_ROUTE) == 0)
return;
- if (ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
+ /*
+ * We should check the existence of dstaddr, because link-local
+ * addresses can be configured without particular destinations
+ * even on point-to-point or loopback interfaces.
+ * In this case, kernel would panic in rtinit()...
+ */
+ if (ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT) &&
+ (ia->ia_ifa.ifa_dstaddr != NULL))
rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST);
else
rtinit(&(ia->ia_ifa), (int)RTM_DELETE, 0);