diff options
author | wpaul <wpaul@FreeBSD.org> | 2001-01-20 00:50:51 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2001-01-20 00:50:51 +0000 |
commit | 9cbdff805b63c075131322ca0ce9d2d632663d5a (patch) | |
tree | 0c649da819976eacc82f0883b4e721d7d35418e0 /sys/dev/sf | |
parent | d5548d1daf08ea1c99001353d96d69edf4ded585 (diff) | |
download | FreeBSD-src-9cbdff805b63c075131322ca0ce9d2d632663d5a.zip FreeBSD-src-9cbdff805b63c075131322ca0ce9d2d632663d5a.tar.gz |
Check the return value of sf_encap() and handle errors accordingly.
Diffstat (limited to 'sys/dev/sf')
-rw-r--r-- | sys/dev/sf/if_sf.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index d03934f..b7f6d36 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -1334,12 +1334,22 @@ static void sf_start(ifp) i = SF_IDX_HI(txprod) >> 4; while(sc->sf_ldata->sf_tx_dlist[i].sf_mbuf == NULL) { + if (sc->sf_tx_cnt == (SF_TX_DLIST_CNT - 2)) { + ifp->if_flags |= IFF_OACTIVE; + cur_tx = NULL; + break; + } IF_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; cur_tx = &sc->sf_ldata->sf_tx_dlist[i]; - sf_encap(sc, cur_tx, m_head); + if (sf_encap(sc, cur_tx, m_head)) { + IF_PREPEND(&ifp->if_snd, m_head); + ifp->if_flags |= IFF_OACTIVE; + cur_tx = NULL; + break; + } /* * If there's a BPF listener, bounce a copy of this frame @@ -1350,8 +1360,6 @@ static void sf_start(ifp) SF_INC(i, SF_TX_DLIST_CNT); sc->sf_tx_cnt++; - if (sc->sf_tx_cnt == (SF_TX_DLIST_CNT - 2)) - break; } if (cur_tx == NULL) { |