mirror of
https://github.com/opnsense/src.git
synced 2026-02-04 03:00:53 -06:00
if_vxlan(4): Invoke vxlan_stop event handler only when the interface is configured
It is harmless but pointless to invoke vxlan_stop event handler when the interface was not previously configured. This change will also prevent an assert panic from t4_vxlan_stop_handler(). Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48494 (cherry picked from commit 960c5bb0f6bf44aeb09fa14fd0f82c2e82ebe2e2)
This commit is contained in:
parent
3615581372
commit
65b8215cc3
@ -1814,6 +1814,7 @@ vxlan_teardown_locked(struct vxlan_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct vxlan_socket *vso;
|
||||
bool running;
|
||||
|
||||
sx_assert(&vxlan_sx, SA_XLOCKED);
|
||||
VXLAN_LOCK_WASSERT(sc);
|
||||
@ -1821,6 +1822,7 @@ vxlan_teardown_locked(struct vxlan_softc *sc)
|
||||
|
||||
ifp = sc->vxl_ifp;
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
running = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0;
|
||||
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
||||
callout_stop(&sc->vxl_callout);
|
||||
vso = sc->vxl_sock;
|
||||
@ -1828,8 +1830,10 @@ vxlan_teardown_locked(struct vxlan_softc *sc)
|
||||
|
||||
VXLAN_WUNLOCK(sc);
|
||||
if_link_state_change(ifp, LINK_STATE_DOWN);
|
||||
EVENTHANDLER_INVOKE(vxlan_stop, ifp, sc->vxl_src_addr.in4.sin_family,
|
||||
ntohs(sc->vxl_src_addr.in4.sin_port));
|
||||
if (running)
|
||||
EVENTHANDLER_INVOKE(vxlan_stop, ifp,
|
||||
sc->vxl_src_addr.in4.sin_family,
|
||||
ntohs(sc->vxl_src_addr.in4.sin_port));
|
||||
|
||||
if (vso != NULL) {
|
||||
vxlan_socket_remove_softc(vso, sc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user