SIOCSIFNAME: Do nothing if we're not actually changing

Instead of throwing EEXIST, just succeed if the name isn't actually
changing. We don't need to trigger departure or any of that because there's
no change from consumers' perspective.

PR:		240539
Reviewed by:	brooks
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D21618
This commit is contained in:
Kyle Evans 2019-09-12 15:36:48 +00:00
parent 5163b1a75c
commit 40b1c921bd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352246

View File

@ -2716,6 +2716,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
if (strlen(new_name) == IFNAMSIZ-1)
return (EINVAL);
}
if (strcmp(new_name, ifp->if_xname) == 0)
break;
if (ifunit(new_name) != NULL)
return (EEXIST);