| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if.c,v 1.433 2018/08/10 10:31:01 knakahara Exp $ */ | | 1 | /* $NetBSD: if.c,v 1.434 2018/08/27 04:53:24 ozaki-r Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by William Studenmund and Jason R. Thorpe. | | 8 | * by William Studenmund and Jason R. Thorpe. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -80,27 +80,27 @@ | | | @@ -80,27 +80,27 @@ |
80 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 80 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
81 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 81 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
82 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 82 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
83 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 83 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
84 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 84 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
85 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 85 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
86 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 86 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
87 | * SUCH DAMAGE. | | 87 | * SUCH DAMAGE. |
88 | * | | 88 | * |
89 | * @(#)if.c 8.5 (Berkeley) 1/9/95 | | 89 | * @(#)if.c 8.5 (Berkeley) 1/9/95 |
90 | */ | | 90 | */ |
91 | | | 91 | |
92 | #include <sys/cdefs.h> | | 92 | #include <sys/cdefs.h> |
93 | __KERNEL_RCSID(0, "$NetBSD: if.c,v 1.433 2018/08/10 10:31:01 knakahara Exp $"); | | 93 | __KERNEL_RCSID(0, "$NetBSD: if.c,v 1.434 2018/08/27 04:53:24 ozaki-r Exp $"); |
94 | | | 94 | |
95 | #if defined(_KERNEL_OPT) | | 95 | #if defined(_KERNEL_OPT) |
96 | #include "opt_inet.h" | | 96 | #include "opt_inet.h" |
97 | #include "opt_ipsec.h" | | 97 | #include "opt_ipsec.h" |
98 | #include "opt_atalk.h" | | 98 | #include "opt_atalk.h" |
99 | #include "opt_natm.h" | | 99 | #include "opt_natm.h" |
100 | #include "opt_wlan.h" | | 100 | #include "opt_wlan.h" |
101 | #include "opt_net_mpsafe.h" | | 101 | #include "opt_net_mpsafe.h" |
102 | #include "opt_mrouting.h" | | 102 | #include "opt_mrouting.h" |
103 | #endif | | 103 | #endif |
104 | | | 104 | |
105 | #include <sys/param.h> | | 105 | #include <sys/param.h> |
106 | #include <sys/mbuf.h> | | 106 | #include <sys/mbuf.h> |
| @@ -2316,26 +2316,27 @@ void | | | @@ -2316,26 +2316,27 @@ void |
2316 | if_link_state_change_softint(struct ifnet *ifp, int link_state) | | 2316 | if_link_state_change_softint(struct ifnet *ifp, int link_state) |
2317 | { | | 2317 | { |
2318 | struct domain *dp; | | 2318 | struct domain *dp; |
2319 | int s = splnet(); | | 2319 | int s = splnet(); |
2320 | bool notify; | | 2320 | bool notify; |
2321 | | | 2321 | |
2322 | KASSERT(!cpu_intr_p()); | | 2322 | KASSERT(!cpu_intr_p()); |
2323 | | | 2323 | |
2324 | IF_LINK_STATE_CHANGE_LOCK(ifp); | | 2324 | IF_LINK_STATE_CHANGE_LOCK(ifp); |
2325 | | | 2325 | |
2326 | /* Ensure the change is still valid. */ | | 2326 | /* Ensure the change is still valid. */ |
2327 | if (ifp->if_link_state == link_state) { | | 2327 | if (ifp->if_link_state == link_state) { |
2328 | IF_LINK_STATE_CHANGE_UNLOCK(ifp); | | 2328 | IF_LINK_STATE_CHANGE_UNLOCK(ifp); |
| | | 2329 | splx(s); |
2329 | return; | | 2330 | return; |
2330 | } | | 2331 | } |
2331 | | | 2332 | |
2332 | #ifdef DEBUG | | 2333 | #ifdef DEBUG |
2333 | log(LOG_DEBUG, "%s: link state %s (was %s)\n", ifp->if_xname, | | 2334 | log(LOG_DEBUG, "%s: link state %s (was %s)\n", ifp->if_xname, |
2334 | link_state == LINK_STATE_UP ? "UP" : | | 2335 | link_state == LINK_STATE_UP ? "UP" : |
2335 | link_state == LINK_STATE_DOWN ? "DOWN" : | | 2336 | link_state == LINK_STATE_DOWN ? "DOWN" : |
2336 | "UNKNOWN", | | 2337 | "UNKNOWN", |
2337 | ifp->if_link_state == LINK_STATE_UP ? "UP" : | | 2338 | ifp->if_link_state == LINK_STATE_UP ? "UP" : |
2338 | ifp->if_link_state == LINK_STATE_DOWN ? "DOWN" : | | 2339 | ifp->if_link_state == LINK_STATE_DOWN ? "DOWN" : |
2339 | "UNKNOWN"); | | 2340 | "UNKNOWN"); |
2340 | #endif | | 2341 | #endif |
2341 | | | 2342 | |