| Summary: | VLAN driver fails to hanlde interface flags properly | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Yar Tikhiy <yar> | ||||
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.1-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
State Changed From-To: open->closed Fixed in both branches |
1. Many network interface drivers' XX_start() routines don't check if an interface is up and running because they rely on upper layers doing that. The vlan_start() routine, which calls XX_start() routines of underlying "parent" drivers, fails to do that, causing system panic when a packet is being sent via a vlan interface while its parnet interface is down. 2. The VLAN driver copies flags from a parent interface to a vlan interface mindlessly. However, setting some flags implies certain additional actions. In particular, bringing an interface up involves setting up a link-layer route to it. The VLAN driver fails to do that because it just copies the bit. 3. The if_up() and if_down() routines must be called at splnet() or equivalent. They also shouldn't be called if an interface is already up or down, correspondingly, because they do no additional checks. The VLAN driver is not aware of the above. I'd also suggest adding a couple of words on the properties of if_up()/if_down() to the ifnet(9) man page. How-To-Repeat: 1. Try to assign an IP address to a VLAN interface which parent is down and see the system panic due to sending a gratituous ARP through the parent. 2. Assign a parent and an IP address to a VLAN interface. Then remove the parent with "ifconfig vlanX -vlandev". Then add another (or the same) parent back. See that packets don't go out, because there is no proper link-layer route to the VLAN interface.