diff options
author | wpaul <wpaul@FreeBSD.org> | 2003-07-06 03:24:25 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2003-07-06 03:24:25 +0000 |
commit | 0721598de290cba8b6600384f5349b552d4c7f4c (patch) | |
tree | bd343ec552f09ad8a4a812566a0744b3e37eff03 /bin/stty | |
parent | d8255b79a730f09b7042de514cea037221a16512 (diff) | |
download | FreeBSD-src-0721598de290cba8b6600384f5349b552d4c7f4c.zip FreeBSD-src-0721598de290cba8b6600384f5349b552d4c7f4c.tar.gz |
Testing VLANs with the new 8139C+ chip (which does hardware tag
insertion and extraction) has revealed two bugs:
- In vlan_start(), we're supposed to check the underlying interface to
see if it has the IFCAP_VLAN_HWTAGGING cabability set and, if so, set
things up for the VLAN_OUTPUT_TAG() routine. However the code checks
ifp->if_capabilities, which is the vlan pseudo-interface's capabilities
when it should be checking p->if_capabilities, which relates to the
underlying physical interface. Change ifp->if_capabilities to
p->if_capabilities so this works.
- In vlan_input(), we have to extract the 16-bit tag value from the
received frame and use it to figure out which vlan interface gets
the frame. The code that we use to track down the desired vlan
pseudo-interface is:
for (ifv = LIST_FIRST(&ifv_list); ifv != NULL;
ifv = LIST_NEXT(ifv, ifv_list))
if (ifp == ifv->ifv_p && tag == ifv->ifv_tag)
break;
The problem is that 'tag' is not computed consistently. In the case
where the interface supports hardware VLAN tag extraction and calls
VLAN_INPUT_TAG(), we do this:
tag = *(u_int*)(mtag+1);
But in the software emulation case, we do this
tag = EVL_VLANOFTAG(ntohs(evl->evl_tag));
The problem here is the EVL_VLANOFTAG() macro is only ever applied
in this one case. It's never applied to ifv->ifv_tag or anwhere else.
We must be consistent: either it's applied everywhere or nowhere.
To see how this can be a problem, do something like
ifconfig vlan0 vlan 12345 vlandev foo0 and observe the results.
I'm not quite sure what the right thing is to do here. Neither the
vlan(4) nor ifconfig(8) man pages suggest which way to go. For now,
I've removed this use of EVL_VLANOFTAG() so that the tag will match
correctly in all cases. I will not get upset if somebody makes a
compelling argument for using EVL_VLANOFTAG() everywhere instead,
as long as the use is consistent.
Diffstat (limited to 'bin/stty')
0 files changed, 0 insertions, 0 deletions