Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 PR/47576: Takahiro HAYASHI: Avoid crash destroy...



details:   https://anonhg.NetBSD.org/src/rev/174e8226bf18
branches:  trunk
changeset: 785016:174e8226bf18
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 18 16:45:50 2013 +0000

description:
PR/47576: Takahiro HAYASHI: Avoid crash destroying tap0 after deleting
it's link-local address.

diffstat:

 sys/netinet6/nd6_rtr.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (35 lines):

diff -r 457005d735f6 -r 174e8226bf18 sys/netinet6/nd6_rtr.c
--- a/sys/netinet6/nd6_rtr.c    Mon Feb 18 16:03:25 2013 +0000
+++ b/sys/netinet6/nd6_rtr.c    Mon Feb 18 16:45:50 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6_rtr.c,v 1.85 2013/01/28 17:57:34 joerg Exp $       */
+/*     $NetBSD: nd6_rtr.c,v 1.86 2013/02/18 16:45:50 christos Exp $    */
 /*     $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $        */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.85 2013/01/28 17:57:34 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.86 2013/02/18 16:45:50 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1038,10 +1038,12 @@
                free(pfr, M_IP6NDP);
        }
 
-       ext->nprefixes--;
-       if (ext->nprefixes < 0) {
-               log(LOG_WARNING, "prelist_remove: negative count on %s\n",
-                   pr->ndpr_ifp->if_xname);
+       if (ext) {
+               ext->nprefixes--;
+               if (ext->nprefixes < 0) {
+                       log(LOG_WARNING, "prelist_remove: negative count on "
+                           "%s\n", pr->ndpr_ifp->if_xname);
+               }
        }
        splx(s);
 



Home | Main Index | Thread Index | Old Index