summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-04-22 05:27:13 +0000
committeradrian <adrian@FreeBSD.org>2013-04-22 05:27:13 +0000
commit13b5f44804e74c0740d22aa1e2f1fbbda1d19278 (patch)
tree56f695f34c88e17cbb886473e634252c3ae38570 /sbin
parent6089bf07c71a6fd15cb36b50f7801a4b09037460 (diff)
downloadFreeBSD-src-13b5f44804e74c0740d22aa1e2f1fbbda1d19278.zip
FreeBSD-src-13b5f44804e74c0740d22aa1e2f1fbbda1d19278.tar.gz
Initialise this to zero before using it to configure the vlangroup
information. PR: kern/177871 Submitted by: Luiz Otavio O Souza <loos.br@gmail.com>
Diffstat (limited to 'sbin')
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c
index ea2cec8..b7ee02c 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.c
+++ b/sbin/etherswitchcfg/etherswitchcfg.c
@@ -139,6 +139,7 @@ set_port_vlangroup(struct cfg *cfg, char *argv[])
v = strtol(argv[1], NULL, 0);
if (v < 0 || v >= cfg->info.es_nvlangroups)
errx(EX_USAGE, "vlangroup must be between 0 and %d", cfg->info.es_nvlangroups-1);
+ bzero(&p, sizeof(p));
p.es_port = cfg->unit;
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)");
OpenPOWER on IntegriCloud