Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Fix inappropriate rt_flags check



details:   https://anonhg.NetBSD.org/src/rev/63f94ebcac15
branches:  trunk
changeset: 811574:63f94ebcac15
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri Nov 06 08:38:43 2015 +0000

description:
Fix inappropriate rt_flags check

It depended on either RTF_CLONED or RTF_CLONING must be set, however,
the assumption didn't meet for userland problems that create a route
via RTM_ADD.

This fixes an issue that running rarpd causes the following kernel panic
reported by nonaka@:
  panic: kernel diagnostic assertion "(la->la_flags & LLE_STATIC) == 0"
  failed: file "/usr/src/sys/netinet/if_arp.c", line 1339

diffstat:

 sys/netinet/if_arp.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r cc8394c57197 -r 63f94ebcac15 sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Fri Nov 06 02:54:37 2015 +0000
+++ b/sys/netinet/if_arp.c      Fri Nov 06 08:38:43 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.191 2015/10/20 07:46:59 ozaki-r Exp $     */
+/*     $NetBSD: if_arp.c,v 1.192 2015/11/06 08:38:43 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.191 2015/10/20 07:46:59 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.192 2015/11/06 08:38:43 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -621,7 +621,7 @@
                 * add with a LL address.
                 */
                flags = LLE_EXCLUSIVE;
-               if ((rt->rt_flags & RTF_CLONED) == 0)
+               if ((rt->rt_flags & RTF_CLONING) != 0)
                        flags |= LLE_IFADDR;
 
                IF_AFDATA_WLOCK(ifp);



Home | Main Index | Thread Index | Old Index