Page MenuHomeFreeBSD

D55123.diff
No OneTemporary

D55123.diff

diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -169,6 +169,11 @@
static struct lagg_port *lagg_link_active(struct lagg_softc *,
struct lagg_port *);
+/* No proto */
+static int lagg_none_start(struct lagg_softc *, struct mbuf *);
+static struct mbuf *lagg_none_input(struct lagg_softc *, struct lagg_port *,
+ struct mbuf *);
+
/* Simple round robin */
static void lagg_rr_attach(struct lagg_softc *);
static int lagg_rr_start(struct lagg_softc *, struct mbuf *);
@@ -220,6 +225,8 @@
} lagg_protos[] = {
{
.pr_num = LAGG_PROTO_NONE
+ .pr_start = lagg_none_start,
+ .pr_input = lagg_none_input,
},
{
.pr_num = LAGG_PROTO_ROUNDROBIN,
@@ -2129,8 +2136,8 @@
if (m->m_pkthdr.csum_flags & CSUM_SND_TAG)
MPASS(m->m_pkthdr.snd_tag->ifp == ifp);
#endif
- /* We need a Tx algorithm and at least one port */
- if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) {
+ /* We need at least one port */
+ if (sc->sc_count == 0) {
m_freem(m);
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return (ENXIO);
@@ -2152,7 +2159,7 @@
MPASS(m->m_pkthdr.snd_tag->ifp == ifp);
#endif
/* We need a Tx algorithm and at least one port */
- if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) {
+ if (sc->sc_count == 0) {
m_freem(m);
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return (ENXIO);
@@ -2180,8 +2187,7 @@
NET_EPOCH_ASSERT();
if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
- lp->lp_detaching != 0 ||
- sc->sc_proto == LAGG_PROTO_NONE) {
+ lp->lp_detaching != 0) {
m_freem(m);
return (NULL);
}
@@ -2215,8 +2221,7 @@
NET_EPOCH_ASSERT();
if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
- lp->lp_detaching != 0 ||
- sc->sc_proto == LAGG_PROTO_NONE) {
+ lp->lp_detaching != 0) {
m_freem(m);
return (NULL);
}
@@ -2391,6 +2396,25 @@
}
/*
+ * No proto
+ */
+static int
+lagg_none_start(struct lagg_softc *sc, struct mbuf *m)
+{
+ m_freem(m);
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
+ /* No available active ports */
+ return (ENETDOWN);
+}
+
+static struct mbuf *
+lagg_none_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m)
+{
+ m_freem(m);
+ return (NULL);
+}
+
+/*
* Simple round robin aggregation
*/
static void

File Metadata

Mime Type
text/plain
Expires
Fri, Feb 6, 7:40 AM (1 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28446857
Default Alt Text
D55123.diff (2 KB)

Event Timeline