Source-Changes-HG archive

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

[src/trunk]: src/sys/net Call in6_ifdetach only if in6_present (for rump)



details:   https://anonhg.NetBSD.org/src/rev/66f6c5e3a8a5
branches:  trunk
changeset: 824243:66f6c5e3a8a5
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon May 29 02:55:49 2017 +0000

description:
Call in6_ifdetach only if in6_present (for rump)

Otherwise ifconfig -vlanif causes a panic on a rump_server without
the netinet6 library.

Reported by s-yamaguchi@IIJ

diffstat:

 sys/net/if_vlan.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 0ce01d53ef3d -r 66f6c5e3a8a5 sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Mon May 29 02:25:37 2017 +0000
+++ b/sys/net/if_vlan.c Mon May 29 02:55:49 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.96 2017/03/15 09:51:08 ozaki-r Exp $     */
+/*     $NetBSD: if_vlan.c,v 1.97 2017/05/29 02:55:49 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.96 2017/03/15 09:51:08 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97 2017/05/29 02:55:49 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -111,6 +111,7 @@
 #endif
 #ifdef INET6
 #include <netinet6/in6_ifattach.h>
+#include <netinet6/in6_var.h>
 #endif
 
 #include "ioconf.h"
@@ -425,7 +426,8 @@
 
 #ifdef INET6
        /* To delete v6 link local addresses */
-       in6_ifdetach(ifp);
+       if (in6_present)
+               in6_ifdetach(ifp);
 #endif
        if ((ifp->if_flags & IFF_PROMISC) != 0)
                ifpromisc(ifp, 0);



Home | Main Index | Thread Index | Old Index