Source-Changes-HG archive

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

[src/netbsd-8]: src Pull up following revision(s) (requested by ozaki-r in ti...



details:   https://anonhg.NetBSD.org/src/rev/753263a0a59c
branches:  netbsd-8
changeset: 434668:753263a0a59c
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Feb 26 00:41:13 2018 +0000

description:
Pull up following revision(s) (requested by ozaki-r in ticket #572):
        sys/net/if_bridge.c: 1.138, 1.148
        tests/net/if_bridge/t_bridge.sh: 1.18
        tests/net/if_gif/t_gif.sh: 1.12
        tests/net/if_ipsec/t_ipsec.sh: 1.3
        tests/net/if_l2tp/t_l2tp.sh: 1.4
        tests/net/if_loop/t_basic.sh: 1.2
        tests/net/if_pppoe/t_pppoe.sh: 1.18
        tests/net/if_tap/t_tap.sh: 1.7
        tests/net/if_tun/Makefile: 1.2
        tests/net/if_tun/t_tun.sh: 1.5
        tests/net/if_vlan/t_vlan.sh: 1.8
        tests/net/net_common.sh: 1.26
Remove unnecessary splsoftnet
--
If the bridge is not running, don't call bridge_stop. Otherwise the
following commands will crash the kernel:
        ifconfig bridge0 create
        ifconfig bridge0 destroy
--
Commonalize and add tests of creating/destroying interfaces

diffstat:

 sys/net/if_bridge.c             |  14 ++++--------
 tests/net/if_bridge/t_bridge.sh |  27 ++++++++++++++++++++++++-
 tests/net/if_gif/t_gif.sh       |  28 +++++++++++++++++++++++++-
 tests/net/if_ipsec/t_ipsec.sh   |  28 +++++++++++++++++++++++++-
 tests/net/if_l2tp/t_l2tp.sh     |  28 +++++++++++++++++++++++++-
 tests/net/if_loop/t_basic.sh    |   9 +------
 tests/net/if_pppoe/t_pppoe.sh   |  27 ++++++++++++++++++++++++-
 tests/net/if_tap/t_tap.sh       |  20 +----------------
 tests/net/if_tun/Makefile       |   7 ++++-
 tests/net/if_tun/t_tun.sh       |   9 +------
 tests/net/if_vlan/t_vlan.sh     |   5 +++-
 tests/net/net_common.sh         |  44 ++++++++++++++++++++++++++++++++++++++++-
 12 files changed, 196 insertions(+), 50 deletions(-)

diffs (truncated from 477 to 300 lines):

diff -r 4465286363c0 -r 753263a0a59c sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Mon Feb 26 00:35:56 2018 +0000
+++ b/sys/net/if_bridge.c       Mon Feb 26 00:41:13 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bridge.c,v 1.134.6.6 2018/01/16 13:01:10 martin Exp $       */
+/*     $NetBSD: if_bridge.c,v 1.134.6.7 2018/02/26 00:41:13 snj Exp $  */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.6 2018/01/16 13:01:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.7 2018/02/26 00:41:13 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -468,11 +468,9 @@
 {
        struct bridge_softc *sc = ifp->if_softc;
        struct bridge_iflist *bif;
-       int s;
-
-       s = splsoftnet();
-
-       bridge_stop(ifp, 1);
+
+       if ((ifp->if_flags & IFF_RUNNING) != 0)
+               bridge_stop(ifp, 1);
 
        BRIDGE_LOCK(sc);
        for (;;) {
@@ -485,8 +483,6 @@
        PSLIST_DESTROY(&sc->sc_iflist_psref.bip_iflist);
        BRIDGE_UNLOCK(sc);
 
-       splx(s);
-
        if_detach(ifp);
 
        /* Tear down the routing table. */
diff -r 4465286363c0 -r 753263a0a59c tests/net/if_bridge/t_bridge.sh
--- a/tests/net/if_bridge/t_bridge.sh   Mon Feb 26 00:35:56 2018 +0000
+++ b/tests/net/if_bridge/t_bridge.sh   Mon Feb 26 00:41:13 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_bridge.sh,v 1.17 2017/03/11 04:24:52 ozaki-r Exp $
+#      $NetBSD: t_bridge.sh,v 1.17.4.1 2018/02/26 00:41:13 snj Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,11 +40,19 @@
 DEBUG=${DEBUG:-false}
 TIMEOUT=5
 
+atf_test_case bridge_create_destroy cleanup
 atf_test_case bridge_ipv4 cleanup
 atf_test_case bridge_ipv6 cleanup
 atf_test_case bridge_member_ipv4 cleanup
 atf_test_case bridge_member_ipv6 cleanup
 
+bridge_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying bridge interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
 bridge_ipv4_head()
 {
        atf_set "descr" "Does simple if_bridge tests"
@@ -312,6 +320,14 @@
        rump.ifconfig -v shmif0
 }
 
+bridge_create_destroy_body()
+{
+
+       rump_server_start $SOCK1 bridge
+
+       test_create_destroy_common $SOCK1 bridge0
+}
+
 bridge_ipv4_body()
 {
        setup
@@ -392,6 +408,13 @@
        rump_server_destroy_ifaces
 }
 
+bridge_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 bridge_ipv4_cleanup()
 {
 
@@ -422,6 +445,8 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case bridge_create_destroy
        atf_add_test_case bridge_ipv4
        atf_add_test_case bridge_ipv6
        atf_add_test_case bridge_member_ipv4
diff -r 4465286363c0 -r 753263a0a59c tests/net/if_gif/t_gif.sh
--- a/tests/net/if_gif/t_gif.sh Mon Feb 26 00:35:56 2018 +0000
+++ b/tests/net/if_gif/t_gif.sh Mon Feb 26 00:41:13 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_gif.sh,v 1.10.2.1 2017/10/21 19:43:55 snj Exp $
+#      $NetBSD: t_gif.sh,v 1.10.2.2 2018/02/26 00:41:13 snj Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -64,6 +64,29 @@
 DEBUG=${DEBUG:-false}
 TIMEOUT=5
 
+atf_test_case gif_create_destroy cleanup
+gif_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying gif interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
+gif_create_destroy_body()
+{
+
+       rump_server_start $SOCK1 netinet6 gif
+
+       test_create_destroy_common $SOCK1 gif0 true
+}
+
+gif_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 setup_router()
 {
        sock=${1}
@@ -757,6 +780,9 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case gif_create_destroy
+
        add_test_allproto basic "basic tests"
        add_test_allproto ioctl "ioctl tests"
        add_test_allproto recursive "recursive check tests"
diff -r 4465286363c0 -r 753263a0a59c tests/net/if_ipsec/t_ipsec.sh
--- a/tests/net/if_ipsec/t_ipsec.sh     Mon Feb 26 00:35:56 2018 +0000
+++ b/tests/net/if_ipsec/t_ipsec.sh     Mon Feb 26 00:41:13 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec.sh,v 1.3.2.2 2018/02/11 21:17:35 snj Exp $
+#      $NetBSD: t_ipsec.sh,v 1.3.2.3 2018/02/26 00:41:13 snj Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -64,6 +64,29 @@
 DEBUG=${DEBUG:-false}
 TIMEOUT=7
 
+atf_test_case ipsecif_create_destroy cleanup
+ipsecif_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying gif interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
+ipsecif_create_destroy_body()
+{
+
+       rump_server_start $SOCK1 ipsec
+
+       test_create_destroy_common $SOCK1 ipsec0
+}
+
+ipsecif_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 setup_router()
 {
        local sock=${1}
@@ -919,6 +942,9 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case ipsecif_create_destroy
+
        add_test_allproto basic "basic tests"
        add_test_allproto ioctl "ioctl tests"
        add_test_allproto recursive "recursive check tests"
diff -r 4465286363c0 -r 753263a0a59c tests/net/if_l2tp/t_l2tp.sh
--- a/tests/net/if_l2tp/t_l2tp.sh       Mon Feb 26 00:35:56 2018 +0000
+++ b/tests/net/if_l2tp/t_l2tp.sh       Mon Feb 26 00:41:13 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_l2tp.sh,v 1.2.8.1 2017/10/21 19:43:55 snj Exp $
+#      $NetBSD: t_l2tp.sh,v 1.2.8.2 2018/02/26 00:41:13 snj Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -49,6 +49,29 @@
 TIMEOUT=5
 DEBUG=${DEBUG:-false}
 
+atf_test_case l2tp_create_destroy cleanup
+l2tp_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying l2tp interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
+l2tp_create_destroy_body()
+{
+
+       rump_server_start $LAC1SOCK l2tp
+
+       test_create_destroy_common $LAC1SOCK l2tp0
+}
+
+l2tp_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 setup_lac()
 {
        sock=${1}
@@ -435,6 +458,9 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case l2tp_create_destroy
+
        add_test_allproto basic "basic tests"
 #      add_test_allproto recursive "recursive check tests"
 }
diff -r 4465286363c0 -r 753263a0a59c tests/net/if_loop/t_basic.sh
--- a/tests/net/if_loop/t_basic.sh      Mon Feb 26 00:35:56 2018 +0000
+++ b/tests/net/if_loop/t_basic.sh      Mon Feb 26 00:41:13 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_basic.sh,v 1.1 2017/02/28 03:32:11 ozaki-r Exp $
+#      $NetBSD: t_basic.sh,v 1.1.8.1 2018/02/26 00:41:14 snj Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -41,12 +41,7 @@
 
        rump_server_start $SOCK_LOCAL netinet6
 
-       export RUMP_SERVER=${SOCK_LOCAL}
-
-       atf_check -s exit:0 rump.ifconfig lo1 create
-       atf_check -s exit:0 rump.ifconfig lo1 up
-       atf_check -s exit:0 rump.ifconfig lo1 down
-       atf_check -s exit:0 rump.ifconfig lo1 destroy
+       test_create_destroy_common $SOCK_LOCAL lo1 true
 }
 
 loop_create_destroy_cleanup()
diff -r 4465286363c0 -r 753263a0a59c tests/net/if_pppoe/t_pppoe.sh
--- a/tests/net/if_pppoe/t_pppoe.sh     Mon Feb 26 00:35:56 2018 +0000
+++ b/tests/net/if_pppoe/t_pppoe.sh     Mon Feb 26 00:41:13 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_pppoe.sh,v 1.17 2017/03/28 01:27:46 ozaki-r Exp $
+#      $NetBSD: t_pppoe.sh,v 1.17.4.1 2018/02/26 00:41:14 snj Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -39,6 +39,29 @@
 WAITTIME=10
 DEBUG=${DEBUG:-false}
 
+atf_test_case pppoe_create_destroy cleanup
+pppoe_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying pppoe interfaces"
+       atf_set "require.progs" "rump_server"
+}
+



Home | Main Index | Thread Index | Old Index