diff options
author | itojun <itojun@FreeBSD.org> | 2000-08-11 12:27:07 +0000 |
---|---|---|
committer | itojun <itojun@FreeBSD.org> | 2000-08-11 12:27:07 +0000 |
commit | adb62d889fd8abefaf9ec1622f84a8693052707f (patch) | |
tree | 29003457da95311a3f2a5661a46ca8bca3ba14fc /sys/netinet6 | |
parent | 431640cc8c546ac031037db43572a902cc6ce89c (diff) | |
download | FreeBSD-src-adb62d889fd8abefaf9ec1622f84a8693052707f.zip FreeBSD-src-adb62d889fd8abefaf9ec1622f84a8693052707f.tar.gz |
avoid duplicated rtfree() on default router list change (could cause panic).
sync with kame 1.46 -> 1.47.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index f403371..e2d2a8d 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $KAME: nd6_rtr.c,v 1.43 2000/07/02 23:19:59 itojun Exp $ */ +/* $KAME: nd6_rtr.c,v 1.47 2000/08/08 08:58:42 jinmei Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -546,12 +546,15 @@ defrouter_delreq(dr, dofree) (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt); if (oldrt) { -#ifdef ND6_USE_RTSOCK defrouter_msg(RTM_DELETE, oldrt); -#endif - if (oldrt->rt_refcnt <= 0) - oldrt->rt_refcnt++; /* XXX */ - rtfree(oldrt); + if (oldrt->rt_refcnt <= 0) { + /* + * XXX: borrowed from the RTM_DELETE case of + * rtrequest(). + */ + oldrt->rt_refcnt++; + rtfree(oldrt); + } } if (dofree) /* XXX: necessary? */ |