diff options
| author | Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> | 2026-07-30 22:22:54 +0000 |
|---|---|---|
| committer | Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> | 2026-07-30 22:31:24 +0000 |
| commit | 491f8d06a97ddea44857725537d1031f2d6a9889 (patch) | |
| tree | d8fe2bfb31b34ee88641cd357205473df6a2cb7e | |
| parent | a28c2890f44877b6399f1a87bd6e67634757b08c (diff) | |
if_gre(4): Fix link state announcement in SIOCDIFPHYADDR
Since we unlock gre before if_detach() and use slock in gre_clone_modify_nl()
there is no need to split if_link_state_change() out of gre_delete_tunnel().
Reported by: markj
Fixes: a0d2e5ebaa2e ("if_gre(4): Fix races by changing initialization order and locks")
| -rw-r--r-- | sys/net/if_gre.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 1dc82238c6ab..4f97371148f0 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -405,7 +405,6 @@ gre_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, if (sc != NULL) gre_delete_tunnel(sc); sx_xunlock(&gre_ioctl_sx); - if_link_state_change(ifp, LINK_STATE_DOWN); } #endif /* VIMAGE */ @@ -419,7 +418,6 @@ gre_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags) gre_delete_tunnel(sc); ifp->if_softc = NULL; sx_xunlock(&gre_ioctl_sx); - if_link_state_change(GRE2IFP(sc), LINK_STATE_DOWN); bpfdetach(ifp); if_detach(ifp); @@ -662,6 +660,7 @@ gre_delete_tunnel(struct gre_softc *sc) sc->gre_so = NULL; } GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(GRE2IFP(sc), LINK_STATE_DOWN); } struct gre_list * |
