From 6bafb37ece1e52de1cae1ff0e363e20d30589df2 Mon Sep 17 00:00:00 2001 From: fenner Date: Sat, 6 Oct 2001 05:02:11 +0000 Subject: - Fix typo in "didn't find tag in list" code -- != should have been ==. This fixes the panic when receiving a packet with an unknown tag, and also allows reception of packets with known tags. - Allow overlapping tag number spaces when using multiple hardware-assisted VLAN parent devices (by comparing the parent interface in vlan_input_tag() just as in vlan_input() ). - fix typo in comment MFC after: 1 week --- sys/net/if_vlan.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index d84a4b9..0f9cfff 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -403,11 +403,12 @@ vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t) for (ifv = LIST_FIRST(&ifv_list); ifv != NULL; ifv = LIST_NEXT(ifv, ifv_list)) { - if (ifv->ifv_tag == t) + if (m->m_pkthdr.rcvif == ifv->ifv_p + && ifv->ifv_tag == t) break; } - if (ifv !=NULL || (ifv->ifv_if.if_flags & IFF_UP) == 0) { + if (ifv == NULL || (ifv->ifv_if.if_flags & IFF_UP) == 0) { m_free(m); return -1; /* So the parent can take note */ } @@ -415,7 +416,7 @@ vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t) /* * Having found a valid vlan interface corresponding to * the given source interface and vlan tag, run the - * the real packet through ethert_input(). + * the real packet through ether_input(). */ m->m_pkthdr.rcvif = &ifv->ifv_if; @@ -437,7 +438,7 @@ vlan_input(struct ether_header *eh, struct mbuf *m) break; } - if (ifv != NULL || (ifv->ifv_if.if_flags & IFF_UP) == 0) { + if (ifv == NULL || (ifv->ifv_if.if_flags & IFF_UP) == 0) { m_freem(m); return -1; /* so ether_input can take note */ } -- cgit v1.1