Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109415878
D30839.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30839.diff
View Options
diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5
--- a/sbin/devd/devd.conf.5
+++ b/sbin/devd/devd.conf.5
@@ -40,7 +40,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.Dd October 12, 2020
+.Dd June 23, 2021
.Dt DEVD.CONF 5
.Os
.Sh NAME
@@ -467,6 +467,8 @@
The network interface is attached to the system.
.It Li IFNET Ta Em inet Ta Li DETACH Ta
The network interface is detached from the system.
+.It Li IFNET Ta Em inet Ta Li RENAME Ta
+The network interface is renamed.
.El
.Pp
.Bl -column "System" "Subsystem" "1234567" -compact
diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2468,6 +2468,7 @@
size_t descrlen;
char *descrbuf, *odescrbuf;
char new_name[IFNAMSIZ];
+ char old_name[IFNAMSIZ], strbuf[IFNAMSIZ + 8];
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
@@ -2673,6 +2674,7 @@
if_printf(ifp, "changing name to '%s'\n", new_name);
IF_ADDR_WLOCK(ifp);
+ strlcpy(old_name, ifp->if_xname, sizeof(old_name));
strlcpy(ifp->if_xname, new_name, sizeof(ifp->if_xname));
ifa = ifp->if_addr;
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
@@ -2700,6 +2702,9 @@
rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
ifp->if_flags &= ~IFF_RENAMING;
+
+ snprintf(strbuf, sizeof(strbuf), "name=%s", new_name);
+ devctl_notify("IFNET", old_name, "RENAME", strbuf);
break;
#ifdef VIMAGE
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 6:58 PM (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16479103
Default Alt Text
D30839.diff (1 KB)
Attached To
Mode
D30839: add RENAME devctl event for IFNET
Attached
Detach File
Event Timeline
Log In to Comment