Created attachment 249353 [details] Coredump text I have a panic when attaching if_bge on a Supermicro H13SSL-N The board has BCM7520 onboard LAN.
Created attachment 249354 [details] Backtrace
The panic actually happens when calling SIOCGIFMEDIA in ifmedia_ioctl() in sys/net/if_media.c from get_operstate_ether() in /usr/src/sys/netlink/route/iface.c (*ifm->ifm_status)(ifp, ifmr); with unpopulated ifm: ifm->ifm_mask = 0 ifm->ifm_media = 0 ifm->ifm_cur = 0x0 ifm->ifm_change = 0x0 ifm->ifm_status = 0x0
I can confirm that this workaround avoids the panic makes the network card operate: --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -272,19 +272,19 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, /* * Get list of available media and current media on interface. */ case SIOCGIFMEDIA: case SIOCGIFXMEDIA: { struct ifmedia_entry *ep; int i; - if (ifmr->ifm_count < 0) + if (ifmr->ifm_count < 0 || ifm->ifm_status == NULL) return (EINVAL); if (cmd == SIOCGIFMEDIA) { ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ? compat_media(ifm->ifm_cur->ifm_media) : IFM_NONE; } else { ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ? ifm->ifm_cur->ifm_media : IFM_NONE; }
Created attachment 249689 [details] Workarounbd patch