diff options
author | glebius <glebius@FreeBSD.org> | 2005-12-18 18:24:27 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-12-18 18:24:27 +0000 |
commit | 175e16aa4df4f5510a7a395b24bd5ac9a00145f9 (patch) | |
tree | edde4e6e448953c23a09236086ca19000c7a4fb5 /sys/dev | |
parent | 035fda79903772207b9132abc6ed91ac80535900 (diff) | |
download | FreeBSD-src-175e16aa4df4f5510a7a395b24bd5ac9a00145f9.zip FreeBSD-src-175e16aa4df4f5510a7a395b24bd5ac9a00145f9.tar.gz |
- Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag in
case if memory allocation failed.
- Remove fourth argument from VLAN_INPUT_TAG(), that was used
incorrectly in almost all drivers. Indicate failure with
mbuf value of NULL.
In collaboration with: yongari, ru, sam
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/bge/if_bge.c | 7 | ||||
-rw-r--r-- | sys/dev/em/if_em.c | 3 | ||||
-rw-r--r-- | sys/dev/ixgb/if_ixgb.c | 3 | ||||
-rw-r--r-- | sys/dev/nge/if_nge.c | 4 | ||||
-rw-r--r-- | sys/dev/re/if_re.c | 7 | ||||
-rw-r--r-- | sys/dev/ti/if_ti.c | 7 | ||||
-rw-r--r-- | sys/dev/txp/if_txp.c | 5 | ||||
-rw-r--r-- | sys/dev/vge/if_vge.c | 7 |
8 files changed, 28 insertions, 15 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index f76309b..16fc559 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2623,8 +2623,11 @@ bge_rxeof(sc) * If we received a packet with a vlan tag, * attach that information to the packet. */ - if (have_tag) - VLAN_INPUT_TAG(ifp, m, vlan_tag, continue); + if (have_tag) { + VLAN_INPUT_TAG(ifp, m, vlan_tag); + if (m == NULL) + continue; + } BGE_UNLOCK(sc); (*ifp->if_input)(ifp, m); diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 192777d..8f8f465 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -2970,8 +2970,7 @@ em_process_receive_interrupts(struct adapter * adapter, int count) if (current_desc->status & E1000_RXD_STAT_VP) VLAN_INPUT_TAG(ifp, adapter->fmp, (le16toh(current_desc->special) & - E1000_RXD_SPC_VLAN_MASK), - adapter->fmp = NULL); + E1000_RXD_SPC_VLAN_MASK)); #ifndef __NO_STRICT_ALIGNMENT skip: #endif diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index 710ebec..788b398 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -2153,8 +2153,7 @@ ixgb_process_receive_interrupts(struct adapter * adapter, int count) adapter->fmp); if (current_desc->status & IXGB_RX_DESC_STATUS_VP) VLAN_INPUT_TAG(ifp, adapter->fmp, - current_desc->special, - adapter->fmp = NULL); + current_desc->special); if (adapter->fmp != NULL) { IXGB_UNLOCK(adapter); diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 70d99bd..74f8f9a 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -1229,7 +1229,9 @@ nge_rxeof(sc) */ if (extsts & NGE_RXEXTSTS_VLANPKT) { VLAN_INPUT_TAG(ifp, m, - ntohs(extsts & NGE_RXEXTSTS_VTCI), continue); + ntohs(extsts & NGE_RXEXTSTS_VTCI)); + if (m == NULL) + continue; } NGE_UNLOCK(sc); (*ifp->if_input)(ifp, m); diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 28f9c2a..6143ba2 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1671,9 +1671,12 @@ re_rxeof(sc) } } - if (rxvlan & RL_RDESC_VLANCTL_TAG) + if (rxvlan & RL_RDESC_VLANCTL_TAG) { VLAN_INPUT_TAG(ifp, m, - ntohs((rxvlan & RL_RDESC_VLANCTL_DATA)), continue); + ntohs((rxvlan & RL_RDESC_VLANCTL_DATA))); + if (m == NULL) + continue; + } RL_UNLOCK(sc); (*ifp->if_input)(ifp, m); RL_LOCK(sc); diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index a21191b..5b26e63 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -2727,8 +2727,11 @@ ti_rxeof(sc) * If we received a packet with a vlan tag, * tag it before passing the packet upward. */ - if (have_tag) - VLAN_INPUT_TAG(ifp, m, vlan_tag, continue); + if (have_tag) { + VLAN_INPUT_TAG(ifp, m, vlan_tag); + if (m == NULL) + continue; + } TI_UNLOCK(sc); (*ifp->if_input)(ifp, m); TI_LOCK(sc); diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index 6f3429e..ae22015 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -766,8 +766,9 @@ txp_rx_reclaim(sc, r) } if (rxd->rx_stat & RX_STAT_VLAN) { - VLAN_INPUT_TAG(ifp, - m, htons(rxd->rx_vlan >> 16), goto next); + VLAN_INPUT_TAG(ifp, m, htons(rxd->rx_vlan >> 16)); + if (m == NULL) + goto next; } TXP_UNLOCK(sc); diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index 915deb8..b433a01 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -1490,9 +1490,12 @@ vge_rxeof(sc) } } - if (rxstat & VGE_RDSTS_VTAG) + if (rxstat & VGE_RDSTS_VTAG) { VLAN_INPUT_TAG(ifp, m, - ntohs((rxctl & VGE_RDCTL_VLANID)), continue); + ntohs((rxctl & VGE_RDCTL_VLANID))); + if (m == NULL) + continue; + } VGE_UNLOCK(sc); (*ifp->if_input)(ifp, m); |