From: kevans Date: Thu, 12 Sep 2019 15:36:48 +0000 (+0000) Subject: SIOCSIFNAME: Do nothing if we're not actually changing X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ddc4226a7a6bc21d4c99838e62880044b8903e0d;p=freebsd.git 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 --- diff --git a/sys/net/if.c b/sys/net/if.c index d1513d2a32d..cfd0c206588 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -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);