git: 93075bdb813a - main - net: Remove the IFF_RENAMING flag

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 10 Feb 2026 13:51:19 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=93075bdb813a9956e66c711eda2c83fb596711fd

commit 93075bdb813a9956e66c711eda2c83fb596711fd
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-02-09 23:24:02 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-02-10 13:45:06 +0000

    net: Remove the IFF_RENAMING flag
    
    This used to be needed when interface renames were broadcast using the
    ifnet_departure_event eventhandler, but since commit 349fcf079ca3
    ("net: add ifnet_rename_event EVENTHANDLER(9) for interface renaming"),
    it has no purpose.  Remove it.
    
    Reviewed by:    pouria, zlei
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D55171
---
 sbin/ifconfig/ifconfig_netlink.c |  2 +-
 share/man/man9/ifnet.9           |  3 ---
 sys/compat/linux/linux_netlink.c |  1 -
 sys/net/if.c                     | 10 ----------
 sys/net/if.h                     |  1 -
 sys/net/if_bridge.c              |  2 --
 sys/net/if_lagg.c                |  3 ---
 sys/net/if_vlan.c                |  3 ---
 sys/net/if_vxlan.c               |  2 --
 sys/netipsec/ipsec_offload.c     |  2 --
 10 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c
index b5badfd585b8..b1467fde4c93 100644
--- a/sbin/ifconfig/ifconfig_netlink.c
+++ b/sbin/ifconfig/ifconfig_netlink.c
@@ -78,7 +78,7 @@ static const char	*IFFBITS[] = {
 	"STATICARP",		/* 19:0x80000 IFF_STATICARP*/
 	"STICKYARP",		/* 20:0x100000 IFF_STICKYARP*/
 	"DYING",		/* 21:0x200000 IFF_DYING*/
-	"RENAMING",		/* 22:0x400000 IFF_RENAMING*/
+	"",			/* 22:0x400000 */
 	"PALLMULTI",		/* 23:0x800000 IFF_PALLMULTI*/
 	"LOWER_UP",		/* 24:0x1000000 IFF_NETLINK_1*/
 };
diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9
index e81c2990c13c..e0a4dae9c1e4 100644
--- a/share/man/man9/ifnet.9
+++ b/share/man/man9/ifnet.9
@@ -761,9 +761,6 @@ Set when the
 structure of this interface is being released and still has
 .Va if_refcount
 references.
-.It Dv IFF_RENAMING
-.Aq D
-Set when this interface is being renamed.
 .El
 .Ss "Interface Capabilities Flags"
 Interface capabilities are specialized features an interface may
diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c
index 6dd2ad7ad8b0..256f188385ce 100644
--- a/sys/compat/linux/linux_netlink.c
+++ b/sys/compat/linux/linux_netlink.c
@@ -340,7 +340,6 @@ rtnl_if_flags_to_linux(unsigned int if_flags)
 		case IFF_STATICARP:
 		case IFF_STICKYARP:
 		case IFF_DYING:
-		case IFF_RENAMING:
 			/* No Linux analogue */
 			break;
 		case IFF_MULTICAST:
diff --git a/sys/net/if.c b/sys/net/if.c
index 047ccd2ecda7..5c4b1e17f77d 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -3022,14 +3022,6 @@ if_rename(struct ifnet *ifp, char *new_name)
 	if (ifunit(new_name) != NULL)
 		return (EEXIST);
 
-	/*
-	 * XXX: Locking.  Nothing else seems to lock if_flags,
-	 * and there are numerous other races with the
-	 * ifunit() checks not being atomic with namespace
-	 * changes (renames, vmoves, if_attach, etc).
-	 */
-	ifp->if_flags |= IFF_RENAMING;
-
 	if_printf(ifp, "changing name to '%s'\n", new_name);
 
 	IF_ADDR_WLOCK(ifp);
@@ -3058,8 +3050,6 @@ if_rename(struct ifnet *ifp, char *new_name)
 
 	EVENTHANDLER_INVOKE(ifnet_rename_event, ifp, old_name);
 
-	ifp->if_flags &= ~IFF_RENAMING;
-
 	snprintf(strbuf, sizeof(strbuf), "name=%s", new_name);
 	devctl_notify("IFNET", old_name, "RENAME", strbuf);
 
diff --git a/sys/net/if.h b/sys/net/if.h
index 0bbd9906f5cf..7c0a476708d6 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -159,7 +159,6 @@ struct if_data {
 #define	IFF_STATICARP	0x80000		/* (n) static ARP */
 #define	IFF_STICKYARP	0x100000	/* (n) sticky ARP */
 #define	IFF_DYING	0x200000	/* (n) interface is winding down */
-#define	IFF_RENAMING	0x400000	/* (n) interface is being renamed */
 #define	IFF_PALLMULTI	0x800000	/* (n) user-requested allmulti mode */
 #define	IFF_NETLINK_1	0x1000000	/* (n) used by netlink */
 
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 5bdd8613245e..0cd71a20fa35 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -2291,8 +2291,6 @@ bridge_ifdetach(void *arg __unused, struct ifnet *ifp)
 	if (bif)
 		sc = bif->bif_sc;
 
-	if (ifp->if_flags & IFF_RENAMING)
-		return;
 	if (V_bridge_cloner == NULL) {
 		/*
 		 * This detach handler can be called after
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index c30af5bfcc4e..7a8f82286c02 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1164,9 +1164,6 @@ lagg_port_ifdetach(void *arg __unused, struct ifnet *ifp)
 
 	if ((lp = ifp->if_lagg) == NULL)
 		return;
-	/* If the ifnet is just being renamed, don't do anything. */
-	if (ifp->if_flags & IFF_RENAMING)
-		return;
 
 	sc = lp->lp_softc;
 
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index afc3fa3fc79e..f74e3cb209fe 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -761,9 +761,6 @@ vlan_ifdetach(void *arg __unused, struct ifnet *ifp)
 	struct ifvlan *ifv;
 	struct ifvlantrunk *trunk;
 
-	/* If the ifnet is just being renamed, don't do anything. */
-	if (ifp->if_flags & IFF_RENAMING)
-		return;
 	VLAN_XLOCK();
 	trunk = ifp->if_vlantrunk;
 	if (trunk == NULL) {
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
index f3a8410a2258..3d51c3c421ff 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -3616,8 +3616,6 @@ vxlan_ifdetach_event(void *arg __unused, struct ifnet *ifp)
 	struct vxlan_socket *vso;
 	struct vxlan_softc *sc, *tsc;
 
-	if (ifp->if_flags & IFF_RENAMING)
-		return;
 	if ((ifp->if_flags & IFF_MULTICAST) == 0)
 		return;
 
diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c
index 3583fc50f51b..632e99b8cfce 100644
--- a/sys/netipsec/ipsec_offload.c
+++ b/sys/netipsec/ipsec_offload.c
@@ -829,8 +829,6 @@ ipsec_accel_on_ifdown_impl(struct ifnet *ifp)
 static void
 ipsec_accel_ifdetach_event(void *arg __unused, struct ifnet *ifp)
 {
-	if ((ifp->if_flags & IFF_RENAMING) != 0)
-		return;
 	ipsec_accel_on_ifdown_impl(ifp);
 }