1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

Check the return value of sf_encap() and handle errors accordingly.

This commit is contained in:
Bill Paul 2001-01-20 00:50:51 +00:00
parent db13b7118e
commit 89689ecb7c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71276
2 changed files with 22 additions and 6 deletions

View File

@ -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) {

View File

@ -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) {