summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-02-07 06:05:07 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-02-07 06:05:07 +0000
commitad8ebcb6758d6b40520726074fd595ecb6ac70f4 (patch)
tree8a80f62945e7c0100fcf385cc25e2ffc56bb67c6 /sys/netinet6
parent93ba91493c622e9e4b7be6c822d966f8ffab5de4 (diff)
fix ifa refcnt'ing.
fix include file path.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 90247dbbb76..5977eb44145 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.12 2000/02/04 18:13:35 itojun Exp $ */
+/* $OpenBSD: in6.c,v 1.13 2000/02/07 06:05:06 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
@@ -92,7 +92,7 @@
#include <netinet/if_ether.h>
#include <netinet6/nd6.h>
-#include <netinet6/ip6.h>
+#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet6/mld6_var.h>
#include <netinet6/ip6_mroute.h>
@@ -193,7 +193,7 @@ in6_ifloop_request(int cmd, struct ifaddr *ifa)
* loopback address.
*/
if (cmd == RTM_ADD && nrt && ifa != nrt->rt_ifa) {
- nrt->rt_ifa->ifa_refcnt--;
+ IFAFREE(nrt->rt_ifa);
ifa->ifa_refcnt++;
nrt->rt_ifa = ifa;
}
@@ -388,8 +388,6 @@ in6_len2mask(mask, len)
mask->s6_addr8[i] = (0xff00 >> (len % 8)) & 0xff;
}
-int in6_interfaces; /* number of external internet interfaces */
-
#define ifa2ia6(ifa) ((struct in6_ifaddr *)(ifa))
#define ia62ifa(ia6) ((struct ifaddr *)(ia6))
@@ -540,12 +538,11 @@ in6_control(so, cmd, data, ifp, p)
oia->ia_next = ia;
} else
in6_ifaddr = ia;
+ ia->ia_ifa.ifa_refcnt++;
TAILQ_INSERT_TAIL(&ifp->if_addrlist,
(struct ifaddr *)ia, ifa_list);
-
- if ((ifp->if_flags & IFF_LOOPBACK) == 0)
- in6_interfaces++; /*XXX*/
+ oia->ia_next = ia;
}
if (cmd == SIOCAIFADDR_IN6) {