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 *);
@@ -219,7 +224,9 @@
void (*pr_portreq)(struct lagg_port *, void *);
} lagg_protos[] = {
{
- .pr_num = LAGG_PROTO_NONE
+ .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);
@@ -2151,8 +2158,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);
@@ -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);
}
@@ -2390,6 +2395,25 @@
return (ifp->if_transmit)(ifp, m);
}
+/*
+ * 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 active ports available */
+ 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
*/

File Metadata

Mime Type
text/plain
Expires
Fri, May 1, 10:13 AM (11 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28452408
Default Alt Text
D55123.diff (2 KB)

Event Timeline