aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifclone.c
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2016-02-20 11:36:35 +0000
committerKristof Provost <kp@FreeBSD.org>2016-02-20 11:36:35 +0000
commit6fe2e1762eb33d9386b9072e7897911cc3cc844b (patch)
tree9049d73473d91320d6e28bdf63db96195938225f /sbin/ifconfig/ifclone.c
parentc4a4eb59e3159973f1b0bb3efb151d873f3fd79a (diff)
ifconfig(8): can't use 'name' or 'description' when creating interface with auto numbering
If one does 'ifconfig tap create name blah', it will return error because the 'name' command doesn't properly populate the request sent to ioctl(...). The 'description' command has the same bug, and is also fixed with this patch. If one does 'ifconfig tap create mtu 9000 name blah', it DOES work, but 'tap0' (or other sequence number) is echoed, instead of the expected 'blah'. (assuming the name change actually succeeded) Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> Differential Revision: https://reviews.freebsd.org/D5341
Notes
Notes: svn path=/head/; revision=295836
Diffstat (limited to 'sbin/ifconfig/ifclone.c')
-rw-r--r--sbin/ifconfig/ifclone.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifclone.c b/sbin/ifconfig/ifclone.c
index 6a60d419f0fb..0eda4380d51e 100644
--- a/sbin/ifconfig/ifclone.c
+++ b/sbin/ifconfig/ifclone.c
@@ -144,11 +144,12 @@ ifclonecreate(int s, void *arg)
}
/*
- * If we get a different name back than we put in, print it.
+ * If we get a different name back than we put in, update record and
+ * indicate it should be printed later.
*/
if (strncmp(name, ifr.ifr_name, sizeof(name)) != 0) {
strlcpy(name, ifr.ifr_name, sizeof(name));
- printf("%s\n", name);
+ printifname = 1;
}
}