diff options
author | fenner <fenner@FreeBSD.org> | 2001-10-06 05:02:11 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2001-10-06 05:02:11 +0000 |
commit | 6bafb37ece1e52de1cae1ff0e363e20d30589df2 (patch) | |
tree | 7ace8e979a1986dec7595db647c06671e48dbe7c /sys/net/if_vlan.c | |
parent | c47e8a25e5be97e7cb202bdeffac76c5543a1d31 (diff) | |
download | FreeBSD-src-6bafb37ece1e52de1cae1ff0e363e20d30589df2.zip FreeBSD-src-6bafb37ece1e52de1cae1ff0e363e20d30589df2.tar.gz |
- 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
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r-- | sys/net/if_vlan.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 */ } |