From eda6cf02b870dea97e6d98369cab4a301c4e1c0a Mon Sep 17 00:00:00 2001 From: Xin LI Date: Mon, 17 Jun 2013 19:31:03 +0000 Subject: [PATCH] Return ENETDOWN instead of ENOENT when all lagg(4) links are inactive when upper layer tries to transmit packet. This gives better feedback and meaningful errors for applications. MFC after: 2 weeks Reviewed by: thompsa --- sys/net/if_lagg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 843252760cab..11273b2845bf 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -1608,7 +1608,7 @@ lagg_rr_start(struct lagg_softc *sc, struct mbuf *m) */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1656,7 +1656,7 @@ lagg_fail_start(struct lagg_softc *sc, struct mbuf *m) /* Use the master port if active or the next available port */ if ((lp = lagg_link_active(sc, sc->sc_primary)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1785,7 +1785,7 @@ lagg_lb_start(struct lagg_softc *sc, struct mbuf *m) */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */