Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2019 15:36:48 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352246 - head/sys/net
Message-ID:  <201909121536.x8CFamqK099423@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Sep 12 15:36:48 2019
New Revision: 352246
URL: https://svnweb.freebsd.org/changeset/base/352246

Log:
  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

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Thu Sep 12 14:34:46 2019	(r352245)
+++ head/sys/net/if.c	Thu Sep 12 15:36:48 2019	(r352246)
@@ -2716,6 +2716,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
 			if (strlen(new_name) == IFNAMSIZ-1)
 				return (EINVAL);
 		}
+		if (strcmp(new_name, ifp->if_xname) == 0)
+			break;
 		if (ifunit(new_name) != NULL)
 			return (EEXIST);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909121536.x8CFamqK099423>