aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2019-09-12 15:36:48 +0000
committerKyle Evans <kevans@FreeBSD.org>2019-09-12 15:36:48 +0000
commit40b1c921bda293100412e343e1d4aaa405745d12 (patch)
treec1dc8868e796fc69659747b47d8d0f93022055e0 /sys/net/if.c
parent5163b1a75c756d65891611b59dd4302f53e5825b (diff)
downloadsrc-40b1c921bda293100412e343e1d4aaa405745d12.tar.gz
src-40b1c921bda293100412e343e1d4aaa405745d12.zip
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
Notes
Notes: svn path=/head/; revision=352246
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c2
1 files changed, 2 insertions, 0 deletions
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);