Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys IFF_RUNNING checking in Rx and Tx processing is unnecess...
details: https://anonhg.NetBSD.org/src/rev/4beac3fcf2ca
branches: trunk
changeset: 357780:4beac3fcf2ca
user: knakahara <knakahara%NetBSD.org@localhost>
date: Mon Nov 27 05:05:50 2017 +0000
description:
IFF_RUNNING checking in Rx and Tx processing is unnecessary now.
Because the configs of gif (members of gif_var) are protected by psref(9).
diffstat:
sys/net/if_gif.c | 9 ++++-----
sys/netinet/in_gif.c | 6 +++---
sys/netinet6/in6_gif.c | 6 +++---
3 files changed, 10 insertions(+), 11 deletions(-)
diffs (91 lines):
diff -r 59c94fb19b28 -r 4beac3fcf2ca sys/net/if_gif.c
--- a/sys/net/if_gif.c Mon Nov 27 05:03:11 2017 +0000
+++ b/sys/net/if_gif.c Mon Nov 27 05:05:50 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gif.c,v 1.133 2017/11/27 05:02:22 knakahara Exp $ */
+/* $NetBSD: if_gif.c,v 1.134 2017/11/27 05:05:50 knakahara Exp $ */
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.133 2017/11/27 05:02:22 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.134 2017/11/27 05:05:50 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -378,8 +378,7 @@
if (sc == NULL)
return 0;
- if ((sc->gif_if.if_flags & (IFF_UP|IFF_RUNNING))
- != (IFF_UP|IFF_RUNNING))
+ if ((sc->gif_if.if_flags & IFF_UP) == 0)
return 0;
var = gif_getref_variant(sc, &psref);
@@ -492,7 +491,7 @@
goto end;
}
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
+ if ((ifp->if_flags & IFF_UP) == 0) {
m_freem(m);
error = ENETDOWN;
goto end;
diff -r 59c94fb19b28 -r 4beac3fcf2ca sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c Mon Nov 27 05:03:11 2017 +0000
+++ b/sys/netinet/in_gif.c Mon Nov 27 05:05:50 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_gif.c,v 1.90 2017/11/27 05:02:22 knakahara Exp $ */
+/* $NetBSD: in_gif.c,v 1.91 2017/11/27 05:05:51 knakahara Exp $ */
/* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.90 2017/11/27 05:02:22 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.91 2017/11/27 05:05:51 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -216,7 +216,7 @@
ip = mtod(m, const struct ip *);
gifp = &sc->gif_if;
- if ((gifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
+ if ((gifp->if_flags & IFF_UP) == 0) {
m_freem(m);
ip_statinc(IP_STAT_NOGIF);
return;
diff -r 59c94fb19b28 -r 4beac3fcf2ca sys/netinet6/in6_gif.c
--- a/sys/netinet6/in6_gif.c Mon Nov 27 05:03:11 2017 +0000
+++ b/sys/netinet6/in6_gif.c Mon Nov 27 05:05:50 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_gif.c,v 1.88 2017/11/27 05:02:22 knakahara Exp $ */
+/* $NetBSD: in6_gif.c,v 1.89 2017/11/27 05:05:51 knakahara Exp $ */
/* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.88 2017/11/27 05:02:22 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.89 2017/11/27 05:05:51 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -233,7 +233,7 @@
ip6 = mtod(m, struct ip6_hdr *);
gifp = &sc->gif_if;
- if ((gifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
+ if ((gifp->if_flags & IFF_UP) == 0) {
m_freem(m);
IP6_STATINC(IP6_STAT_NOGIF);
return IPPROTO_DONE;
Home |
Main Index |
Thread Index |
Old Index