git: 491f8d06a97d - main - if_gre(4): Fix link state announcement in SIOCDIFPHYADDR
Pouria Mousavizadeh Tehrani <[email protected]> Thu, 30 Jul 2026 22:32:22 +0000
| Newsgroups | gmane.os.freebsd.devel.cvs.src |
|---|---|
| Message-ID | <6a6bd0f6.33091.20fbb4fe__45210.3157922224$1785450775$gmane$org@gitrepo.freebsd.org> |
The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=491f8d06a97ddea44857725537d1031f2d6a9889 commit 491f8d06a97ddea44857725537d1031f2d6a9889 Author: Pouria Mousavizadeh Tehrani <[email protected]> AuthorDate: 2026-07-30 22:22:54 +0000 Commit: Pouria Mousavizadeh Tehrani <[email protected]> CommitDate: 2026-07-30 22:31:24 +0000 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") --- sys/net/if_gre.c | 3 +-- 1 file changed, 1 insertion(+), 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 *