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 @@ -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. .It Li IFNET Ta Em inet Ta Li ADDR_ADD Ta The network interface address added. .It Li IFNET Ta Em inet Ta Li ADDR_DEL Ta diff --git a/sys/net/if.c b/sys/net/if.c --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2477,7 +2477,7 @@ size_t namelen, onamelen; size_t descrlen; char *descrbuf, *odescrbuf; - char new_name[IFNAMSIZ]; + char new_name[IFNAMSIZ], strbuf[IFNAMSIZ + 8]; struct ifaddr *ifa; struct sockaddr_dl *sdl; @@ -2682,6 +2682,9 @@ if_printf(ifp, "changing name to '%s'\n", new_name); + snprintf(strbuf, sizeof(strbuf), "name=%s", new_name); + devctl_notify("IFNET", ifp->if_xname, "RENAME", strbuf); + IF_ADDR_WLOCK(ifp); strlcpy(ifp->if_xname, new_name, sizeof(ifp->if_xname)); ifa = ifp->if_addr;