mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
sfxge: defer ether_ifattach to when ifmedia_init is done
Otherwise the ifmedia subsystem may call unguarded NULL function pointers. Same issue that was fixed for cxgb(4) in f2daf8995. Also see: https://github.com/opnsense/src/issues/228 MFC after: 1 week
This commit is contained in:
parent
b588ace010
commit
cfe989733d
1 changed files with 3 additions and 7 deletions
|
|
@ -611,8 +611,6 @@ sfxge_ifnet_init(if_t ifp, struct sfxge_softc *sc)
|
|||
if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
|
||||
CSUM_TCP_IPV6 | CSUM_UDP_IPV6, 0);
|
||||
|
||||
ether_ifattach(ifp, encp->enc_mac_addr);
|
||||
|
||||
if_settransmitfn(ifp, sfxge_if_transmit);
|
||||
if_setqflushfn(ifp, sfxge_if_qflush);
|
||||
|
||||
|
|
@ -620,13 +618,11 @@ sfxge_ifnet_init(if_t ifp, struct sfxge_softc *sc)
|
|||
|
||||
DBGPRINT(sc->dev, "ifmedia_init");
|
||||
if ((rc = sfxge_port_ifmedia_init(sc)) != 0)
|
||||
goto fail;
|
||||
return (rc);
|
||||
|
||||
ether_ifattach(ifp, encp->enc_mac_addr);
|
||||
|
||||
return (0);
|
||||
|
||||
fail:
|
||||
ether_ifdetach(sc->ifnet);
|
||||
return (rc);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue