mjoras c6f2373c08 Wrap a vlan's parent's if_output in a separate function.
When a vlan interface is created, its if_output is set directly to the
parent interface's if_output. This is fine in the normal case but has an
unfortunate consequence if you end up with a certain combination of vlan
and lagg interfaces.

Consider you have a lagg interface with a single laggport member. When
an interface is added to a lagg its if_output is set to
lagg_port_output, which blackholes traffic from the normal networking
stack but not certain frames from BPF (pseudo_AF_HDRCMPLT). If you now
create a vlan with the laggport member (not the lagg interface) as its
parent, its if_output is set to lagg_port_output as well. While this is
confusing conceptually and likely represents a misconfigured system, it
is not itself a problem. The problem arises when you then remove the
lagg interface. Doing this resets the if_output of the laggport member
back to its original state, but the vlan's if_output is left pointing to
lagg_port_output. This gives rise to the possibility that the system
will panic when e.g. bpf is used to send any frames on the vlan
interface.

Fix this by creating a new function, vlan_output, which simply wraps the
parent's current if_output. That way when the parent's if_output is
restored there is no stale usage of lagg_port_output.

Reviewed by:	rstone
Differential Revision:	D21209
2019-08-30 20:19:43 +00:00
..
2019-08-29 18:23:38 +00:00
2019-08-29 07:25:27 +00:00
2019-08-28 16:18:23 +00:00
2019-08-30 00:30:03 +00:00
2019-08-22 04:31:07 +00:00
2019-08-30 00:45:53 +00:00
2019-08-25 17:13:00 +00:00
2019-08-29 07:25:27 +00:00
2019-08-29 07:25:27 +00:00
2019-08-29 07:25:27 +00:00
2019-08-29 07:25:27 +00:00
2019-08-30 00:03:41 +00:00
2019-08-29 07:50:25 +00:00
2019-08-29 07:50:25 +00:00