From 40b1c921bda293100412e343e1d4aaa405745d12 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 12 Sep 2019 15:36:48 +0000 Subject: [PATCH] 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 --- sys/net/if.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index d1513d2a32d7..cfd0c2065888 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);