On 08/12/15(Tue) 00:50, Aaron Miller wrote:
> Hi Martin,
>
> It appears to work. After patching, rebuilding, and installing the kernel,
> I could use the Internet with a lot of data transfer. I unplugged and
> plugged back in my wifi dongle twice without any crashes, and the
> Internet kept working.
>
> However, I saw a crash I haven't seen before -- no traceback in ddb,
> just a blank screen (but with the LCD backlight on) and the fan
> spinning. Pressing caps lock didn't toggle the LED.
>
> This crash might be because of something else in the current /usr/src
> tree -- I can't rule that out because I was previously using a
> snapshot from two days earlier and some crashing bug could have been
> introduced since then.
Thanks for testing, I could isolate the fix, diff below is much smaller.
Is it still ok with it?
Index: net/route.c
===================================================================
RCS file: /cvs/src/sys/net/route.c,v
retrieving revision 1.289
diff -u -p -r1.289 route.c
--- net/route.c 5 Dec 2015 10:07:55 -0000 1.289
+++ net/route.c 8 Dec 2015 09:07:49 -0000
@@ -645,6 +645,9 @@ rtdeletemsg(struct rtentry *rt, struct i
static inline int
rtequal(struct rtentry *a, struct rtentry *b)
{
+ if (a == b)
+ return 1;
+
if (memcmp(rt_key(a), rt_key(b), rt_key(a)->sa_len) == 0 &&
rt_plen(a) == rt_plen(b))
return 1;
@@ -656,10 +659,22 @@ int
rtflushclone1(struct rtentry *rt, void *arg, u_int id)
{
struct rtentry *parent = arg;
+ struct ifnet *ifp;
+
+ ifp = if_get(rt->rt_ifidx);
+
+ /*
+ * This happens when an interface with a RTF_CLONING route is
+ * being detached. In this case it's safe to bail because all
+ * the routes are being purged by rt_if_remove().
+ */
+ if (ifp == NULL)
+ return 0;
+
+ if (ISSET(rt->rt_flags, RTF_CLONED) && rtequal(rt->rt_parent, parent))
+ rtdeletemsg(rt, ifp, id);
- if ((rt->rt_flags & RTF_CLONED) != 0 && (rt->rt_parent == parent ||
- rtequal(rt->rt_parent, parent)))
- rtdeletemsg(rt, NULL, id);
+ if_put(ifp);
return 0;
}