Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the

mbuf instead.

Suggested by:	fenner
This commit is contained in:
Brooks Davis 2001-12-03 17:28:27 +00:00
parent 011376308f
commit 437e48e931
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87276
8 changed files with 17 additions and 17 deletions

View file

@ -1906,7 +1906,7 @@ bge_rxeof(sc)
* to vlan_input() instead of ether_input().
*/
if (have_tag) {
VLAN_INPUT_TAG(ifp, eh, m, vlan_tag);
VLAN_INPUT_TAG(eh, m, vlan_tag);
have_tag = vlan_tag = 0;
continue;
}

View file

@ -1318,7 +1318,7 @@ gx_rxeof(struct gx_softc *gx)
* to vlan_input() instead of ether_input().
*/
if (staterr & GX_RXSTAT_VLAN_PKT) {
VLAN_INPUT_TAG(ifp, eh, m, rx->rx_special);
VLAN_INPUT_TAG(eh, m, rx->rx_special);
continue;
}
ether_input(ifp, eh, m);

View file

@ -1337,7 +1337,7 @@ static void nge_rxeof(sc)
* to vlan_input() instead of ether_input().
*/
if (extsts & NGE_RXEXTSTS_VLANPKT) {
VLAN_INPUT_TAG(ifp, eh, m, extsts & NGE_RXEXTSTS_VTCI);
VLAN_INPUT_TAG(eh, m, extsts & NGE_RXEXTSTS_VTCI);
continue;
}

View file

@ -1808,7 +1808,7 @@ static void ti_rxeof(sc)
* to vlan_input() instead of ether_input().
*/
if (have_tag) {
VLAN_INPUT_TAG(ifp, eh, m, vlan_tag);
VLAN_INPUT_TAG(eh, m, vlan_tag);
have_tag = vlan_tag = 0;
continue;
}

View file

@ -805,7 +805,7 @@ txp_rx_reclaim(sc, r)
m_adj(m, sizeof(struct ether_header));
if (rxd->rx_stat & RX_STAT_VLAN) {
VLAN_INPUT_TAG(ifp, eh, m, htons(rxd->rx_vlan >> 16));
VLAN_INPUT_TAG(eh, m, htons(rxd->rx_vlan >> 16));
goto next;
}

View file

@ -102,35 +102,35 @@ extern void (*ng_ether_detach_p)(struct ifnet *ifp);
extern int (*vlan_input_p)(struct ether_header *eh, struct mbuf *m);
extern int (*vlan_input_tag_p)(struct ether_header *eh, struct mbuf *m,
u_int16_t t);
#define _VLAN_INPUT(ifp, eh, m) do { \
#define _VLAN_INPUT(eh, m) do { \
if (vlan_input_p != NULL) { \
if ((*vlan_input_p)(eh, m) == -1) \
(ifp)->if_noproto++; \
(m)->m_pkthdr.rcvif->if_noproto++; \
} else { \
m_free(m); \
(ifp)->if_noproto++; \
(m)->m_pkthdr.rcvif->if_noproto++; \
} \
} while (0)
#define VLAN_INPUT(ifp, eh, m) do { \
#define VLAN_INPUT(eh, m) do { \
/* XXX: lock */ \
_VLAN_INPUT(ifp, eh, m); \
_VLAN_INPUT(eh, m); \
/* XXX: unlock */ \
} while (0)
#define _VLAN_INPUT_TAG(ifp, eh, m, t) do { \
#define _VLAN_INPUT_TAG(eh, m, t) do { \
if (vlan_input_tag_p != NULL) { \
if ((*vlan_input_tag_p)(eh, m, t) == -1) \
(ifp)->if_noproto++; \
(m)->m_pkthdr.rcvif->if_noproto++; \
} else { \
m_free(m); \
(ifp)->if_noproto++; \
(m)->m_pkthdr.rcvif->if_noproto++; \
} \
} while (0)
#define VLAN_INPUT_TAG(ifp, eh, m, t) do { \
#define VLAN_INPUT_TAG(eh, m, t) do { \
/* XXX: lock */ \
_VLAN_INPUT_TAG(ifp, eh, m, t); \
_VLAN_INPUT_TAG(eh, m, t); \
/* XXX: unlock */ \
} while (0)

View file

@ -570,7 +570,7 @@ ether_demux(ifp, eh, m)
return;
#endif /* NETATALK */
case ETHERTYPE_VLAN:
VLAN_INPUT(ifp, eh, m);
VLAN_INPUT(eh, m);
return;
default:
#ifdef IPX

View file

@ -1808,7 +1808,7 @@ static void ti_rxeof(sc)
* to vlan_input() instead of ether_input().
*/
if (have_tag) {
VLAN_INPUT_TAG(ifp, eh, m, vlan_tag);
VLAN_INPUT_TAG(eh, m, vlan_tag);
have_tag = vlan_tag = 0;
continue;
}