From db5a36bddf048fe9fb07ad3f4981cca552e04451 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 22 May 2018 15:35:38 +0000 Subject: [PATCH] Simplify lagg_input(). No functional change intended. MFC after: 2 weeks --- sys/net/if_lagg.c | 13 +++---------- sys/net/if_lagg.h | 3 +-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index c418b698619..07cf0e944fe 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -1680,7 +1680,7 @@ lagg_input(struct ifnet *ifp, struct mbuf *m) LAGG_RLOCK(); if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || - (lp->lp_flags & LAGG_PORT_DISABLED) || + lp->lp_detaching != 0 || sc->sc_proto == LAGG_PROTO_NONE) { LAGG_RUNLOCK(); m_freem(m); @@ -1689,17 +1689,10 @@ lagg_input(struct ifnet *ifp, struct mbuf *m) ETHER_BPF_MTAP(scifp, m); - if (lp->lp_detaching != 0) { + m = lagg_proto_input(sc, lp, m); + if (m != NULL && (scifp->if_flags & IFF_MONITOR) != 0) { m_freem(m); m = NULL; - } else - m = lagg_proto_input(sc, lp, m); - - if (m != NULL) { - if (scifp->if_flags & IFF_MONITOR) { - m_freem(m); - m = NULL; - } } LAGG_RUNLOCK(); diff --git a/sys/net/if_lagg.h b/sys/net/if_lagg.h index 07ef9632552..d65e44b867d 100644 --- a/sys/net/if_lagg.h +++ b/sys/net/if_lagg.h @@ -42,9 +42,8 @@ #define LAGG_PORT_ACTIVE 0x00000004 /* port is active */ #define LAGG_PORT_COLLECTING 0x00000008 /* port is receiving frames */ #define LAGG_PORT_DISTRIBUTING 0x00000010 /* port is sending frames */ -#define LAGG_PORT_DISABLED 0x00000020 /* port is disabled */ #define LAGG_PORT_BITS "\20\01MASTER\02STACK\03ACTIVE\04COLLECTING" \ - "\05DISTRIBUTING\06DISABLED" + "\05DISTRIBUTING" /* Supported lagg PROTOs */ typedef enum { -- 2.45.0