]> xenbits.xensource.com Git - freebsd.git/commitdiff
SIOCSIFNAME: Do nothing if we're not actually changing
authorkevans <kevans@FreeBSD.org>
Thu, 12 Sep 2019 15:36:48 +0000 (15:36 +0000)
committerkevans <kevans@FreeBSD.org>
Thu, 12 Sep 2019 15:36:48 +0000 (15:36 +0000)
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

sys/net/if.c

index d1513d2a32d781da4e93bf62054a5bd72c2b359c..cfd0c20658884da38ebfe906e986c5f484a9c5ab 100644 (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);