lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 18 Jan 2009 22:07:56 +0300
From:	"Matvejchikov Ilya" <matvejchikov@...il.com>
To:	netdev@...r.kernel.org
Subject: [PATCH] net: A little dev_valid_name() improvement

This patch removes redundant complexity when checking the
network device name to be valid.

Signed-off-by: Matvejchikov Ilya <matvejchikov@...il.com>
---
 net/core/dev.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 8d67597..9c5d8f4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -760,12 +760,10 @@ struct net_device * dev_get_by_flags(struct net
*net, unsigned short if_flags, u
  */
 int dev_valid_name(const char *name)
 {
-	if (*name == '\0')
+	if (*name == '\0' || *name == '.')
 		return 0;
 	if (strlen(name) >= IFNAMSIZ)
 		return 0;
-	if (!strcmp(name, ".") || !strcmp(name, ".."))
-		return 0;

 	while (*name) {
 		if (*name == '/' || isspace(*name))
-- 
1.6.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ