summaryrefslogtreecommitdiff
path: root/usr/src/cmd/dladm
diff options
context:
space:
mode:
authorMichael Lim <Michael.Lim@Sun.COM>2009-03-02 17:40:04 -0800
committerMichael Lim <Michael.Lim@Sun.COM>2009-03-02 17:40:04 -0800
commit285e94f91fd7deba72e31d9ecf23ec4769a8323b (patch)
treed0cedd700d7533f13143d671e27a0840c90cd9f0 /usr/src/cmd/dladm
parent30f84f378af0e65672123a8e868229e1d5af882a (diff)
downloadillumos-joyent-285e94f91fd7deba72e31d9ecf23ec4769a8323b.tar.gz
6809684 dladm create-vnic accepts invalid VLAN ID
6797209 Coredump when calling "dladm set-linkprop -p autopush" with 9 modules. 6800512 on sparc, the field "%Util" of dladm show-link -S always equals 0 although the traffic is very heavy
Diffstat (limited to 'usr/src/cmd/dladm')
-rw-r--r--usr/src/cmd/dladm/dladm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c
index 7bba0420bd..0bd80316c5 100644
--- a/usr/src/cmd/dladm/dladm.c
+++ b/usr/src/cmd/dladm/dladm.c
@@ -3860,7 +3860,7 @@ do_create_vnic(int argc, char *argv[], const char *use)
uchar_t *mac_addr;
int mac_slot = -1, maclen = 0, mac_prefix_len = 0;
dladm_arg_list_t *proplist = NULL;
- uint16_t vid = 0;
+ int vid = 0;
opterr = 0;
while ((option = getopt_long(argc, argv, ":tfR:l:m:n:p:r:v:H",
@@ -3920,10 +3920,12 @@ do_create_vnic(int argc, char *argv[], const char *use)
}
break;
case 'v':
- vid = (int)strtol(optarg, &endp, 10);
- if (errno != 0 || *endp != '\0' || vid == 0)
- /* VID of 0 is invalid */
- die("invalid VLAN id");
+ if (vid != 0)
+ die_optdup(option);
+
+ if (!str2int(optarg, &vid) || vid < 1 || vid > 4094)
+ die("invalid VLAN identifier '%s'", optarg);
+
break;
case 'f':
flags |= DLADM_OPT_FORCE;