mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
Zero etherswitch_vlangroup structure before doing partial assignments.
MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate)
This commit is contained in:
parent
00dbeb59ad
commit
08f58fe456
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=308775
|
@ -309,6 +309,7 @@ set_vlangroup_vid(struct cfg *cfg, char *argv[])
|
|||
int v;
|
||||
etherswitch_vlangroup_t vg;
|
||||
|
||||
memset(&vg, 0, sizeof(vg));
|
||||
v = strtol(argv[1], NULL, 0);
|
||||
if (v < 0 || v > IEEE802DOT1Q_VID_MAX)
|
||||
errx(EX_USAGE, "vlan must be between 0 and %d", IEEE802DOT1Q_VID_MAX);
|
||||
|
@ -329,6 +330,7 @@ set_vlangroup_members(struct cfg *cfg, char *argv[])
|
|||
int v;
|
||||
|
||||
member = untagged = 0;
|
||||
memset(&vg, 0, sizeof(vg));
|
||||
if (strcmp(argv[1], "none") != 0) {
|
||||
for (c=argv[1]; *c; c=d) {
|
||||
v = strtol(c, &d, 0);
|
||||
|
|
Loading…
Reference in a new issue