[PATCH 03/12] Prevent renaming interfaces to empty string.

Andreas Henriksson
2007-10-12T08:57:33Z

From: Alexander Wirt <formorer@debian.org>

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
ip/iplink.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ip/iplink.c b/ip/iplink.c
index 4060845..da1f64e 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -670,6 +670,10 @@ static int do_set(int argc, char **argv)
}

if (newname && strcmp(dev, newname)) {
+ if (strlen(newname) == 0) {
+ printf("\"\" is not valid device identifier\n");
+ return -1;
+ }
if (do_changename(dev, newname) < 0)
return -1;
dev = newname;
--
1.5.3.4