Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/netinet6 pullup 1.32 -> 1.33 (approved by releng-1-5)
details: https://anonhg.NetBSD.org/src/rev/c26048a6c0c5
branches: netbsd-1-5
changeset: 488493:c26048a6c0c5
user: itojun <itojun%NetBSD.org@localhost>
date: Thu Jul 13 14:59:50 2000 +0000
description:
pullup 1.32 -> 1.33 (approved by releng-1-5)
fatal bug fix from kame (rtentry refcnt goes negative if we play with IPv6
address/routing table too much).
in6_ifloop_request()
not to request rtrequest to return an rtentry except for the ADD
operation, in order to avoid misdecreasing the refcnt (which might
cause leak of rtentry)
diffstat:
sys/netinet6/in6.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diffs (40 lines):
diff -r 66baa1347cb3 -r c26048a6c0c5 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Thu Jul 13 14:08:45 2000 +0000
+++ b/sys/netinet6/in6.c Thu Jul 13 14:59:50 2000 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: in6.c,v 1.32 2000/04/27 16:44:19 itojun Exp $ */
-/* $KAME: in6.c,v 1.75 2000/04/12 03:51:29 itojun Exp $ */
+/* $NetBSD: in6.c,v 1.32.4.1 2000/07/13 14:59:50 itojun Exp $ */
+/* $KAME: in6.c,v 1.99 2000/07/11 17:00:58 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -174,7 +174,7 @@
{
struct sockaddr_in6 lo_sa;
struct sockaddr_in6 all1_sa;
- struct rtentry *nrt = NULL;
+ struct rtentry *nrt = NULL, **nrtp = NULL;
bzero(&lo_sa, sizeof(lo_sa));
bzero(&all1_sa, sizeof(all1_sa));
@@ -184,11 +184,17 @@
lo_sa.sin6_addr = in6addr_loopback;
all1_sa.sin6_addr = in6mask128;
- /* So we add or remove static loopback entry, here. */
+ /*
+ * So we add or remove static loopback entry, here.
+ * This request for deletion could fail, e.g. when we remove
+ * an address right after adding it.
+ */
+ if (cmd == RTM_ADD)
+ nrtp = &nrt;
rtrequest(cmd, ifa->ifa_addr,
(struct sockaddr *)&lo_sa,
(struct sockaddr *)&all1_sa,
- RTF_UP|RTF_HOST, &nrt);
+ RTF_UP|RTF_HOST, nrtp);
/*
* Make sure rt_ifa be equal to IFA, the second argument of the
Home |
Main Index |
Thread Index |
Old Index