Created attachment 233427 [details] kernel stack trace A friend (Jeff Anton) reported a kernel crash when trying to configure a vlan on a wlan interface under 13.0. I did some testing with a spare amd64 box and was able to reproduce the crash with both 13.1-RC4 and 12.3-RELEASE-p5. The rc.conf from my test setup looks like this: hostname="test.alameda.xse.com" sshd_enable="YES" dumpdev="AUTO" keymap="us.ctrl" wlans_iwn0="wlan0" ifconfig_wlan0="WPA SYNCDHCP" vlans_wlan0="vlan0" create_args_vlan0="vlan 1234" wpa_supplicant="YES" (This assumes a valid wpa_supplicant.conf.) After booting and successfully joining wifi issuing: ifconfig vlan0 192.168.1.1 results in a "page fault while in kernel mode" panic. Kernel stack trace attached (13.1-RC4).
Created attachment 233451 [details] ifconfig vlan fix The vlan driver is calling ieee80211_output() with the wrong ifnet context and dereferencing a bad pointer. It looks like the passed in if_softc is pointing to a struct ifvlan instead of the expected struct ieee80211_vap Looking at vlan_output(), I wonder if the parents ifnet context should be used when calling if_output()? I've attached a patch to show what I mean.
I tested your patch with 12.3-RELEASE-p5 and was able to set an address on vlan0.
For context see: 16cf6bdbb6cb https://reviews.freebsd.org/D21209 c7cffd65c5d8 https://reviews.freebsd.org/D26436