Hi,

this panic cannot possibly happen. The question is, whether to move it up
to the macro that is used in the code, or zap it entirely.
The whole logic in these two seems pretty ugly, but inet6 crashed when I 
tried to make it look prettier and more uniform.  And again, until 5.0 is
out, this might just sit here, or wait on someone's todo list.

--
Martin Pelikan

Index: net/if.h
===================================================================
RCS file: /cvs/src/sys/net/if.h,v
retrieving revision 1.128
diff -u -p -r1.128 if.h
--- net/if.h    8 Jul 2011 18:48:51 -0000       1.128
+++ net/if.h    22 Jul 2011 12:14:01 -0000
@@ -696,6 +696,8 @@ __END_DECLS
 #ifdef _KERNEL
 #define        IFAFREE(ifa) \
 do { \
+       if (ifa == NULL) \
+               panic("IFAFREE"); \
        if ((ifa)->ifa_refcnt <= 0) \
                ifafree(ifa); \
        else \
Index: net/route.c
===================================================================
RCS file: /cvs/src/sys/net/route.c,v
retrieving revision 1.131
diff -u -p -r1.131 route.c
--- net/route.c 4 Jul 2011 04:29:17 -0000       1.131
+++ net/route.c 22 Jul 2011 12:14:01 -0000
@@ -411,8 +411,6 @@ rtfree(struct rtentry *rt)
 void
 ifafree(struct ifaddr *ifa)
 {
-       if (ifa == NULL)
-               panic("ifafree");
        if (ifa->ifa_refcnt == 0)
                free(ifa, M_IFADDR);
        else

Reply via email to