K 10 svn:author V 7 git2svn K 8 svn:date V 27 2021-05-23T00:05:46.461208Z K 7 svn:log V 1677 MFC r351629: sys/net/if_vlan.c: Wrap a vlan's parent's if_output in a separate function. The merge is done in preparation of another merge to support 802.1ad (qinq). Original commit log follows. 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 (cherry picked from commit 16cf6bdbb6cb18a5af7b499034b2176a1fa0a503) Git Hash: 18fa0cbfc4e906fbf824651140f68d0a85c1d08f Git Author: mjoras@FreeBSD.org END