Module Name: src Committed By: snj Date: Fri Aug 14 20:46:13 UTC 2009
Modified Files: src/sbin/ifconfig [netbsd-5-0]: vlan.c Log Message: Pull up following revision(s) (requested by dyoung in ticket #879): sbin/ifconfig/vlan.c: revision 1.13 Don't require a "vlan" argument with "-vlanif". "ifconfig vlan0 -vlanif" works as one would expect, now. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.12.6.1 src/sbin/ifconfig/vlan.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/ifconfig/vlan.c diff -u src/sbin/ifconfig/vlan.c:1.12 src/sbin/ifconfig/vlan.c:1.12.6.1 --- src/sbin/ifconfig/vlan.c:1.12 Tue Jul 15 21:27:58 2008 +++ src/sbin/ifconfig/vlan.c Fri Aug 14 20:46:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vlan.c,v 1.12 2008/07/15 21:27:58 dyoung Exp $ */ +/* $NetBSD: vlan.c,v 1.12.6.1 2009/08/14 20:46:13 snj Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: vlan.c,v 1.12 2008/07/15 21:27:58 dyoung Exp $"); +__RCSID("$NetBSD: vlan.c,v 1.12.6.1 2009/08/14 20:46:13 snj Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -140,17 +140,17 @@ if (getvlan(env, &vlr, false) == -1) err(EXIT_FAILURE, "%s: getsock", __func__); - if (!prop_dictionary_get_int64(env, "vlantag", &tag)) { - errno = ENOENT; - return -1; - } - if (!prop_dictionary_get_cstring_nocopy(env, "vlanif", &parent)) { errno = ENOENT; return -1; } strlcpy(vlr.vlr_parent, parent, sizeof(vlr.vlr_parent)); - if (strcmp(parent, "") != 0) + if (strcmp(parent, "") == 0) + ; + else if (!prop_dictionary_get_int64(env, "vlantag", &tag)) { + errno = ENOENT; + return -1; + } else vlr.vlr_tag = (unsigned short)tag; if (indirect_ioctl(env, SIOCSETVLAN, &vlr) == -1)