summaryrefslogtreecommitdiffstats
path: root/sbin/etherswitchcfg
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2013-07-23 13:56:38 +0000
committerloos <loos@FreeBSD.org>2013-07-23 13:56:38 +0000
commite4f13850f70c2edd8f1918455575694b72741b3e (patch)
tree32395f066ef0466740d4e137c2ced3772250ba58 /sbin/etherswitchcfg
parent88d161491f8f0902491f8df563668a7f3524d4f7 (diff)
downloadFreeBSD-src-e4f13850f70c2edd8f1918455575694b72741b3e.zip
FreeBSD-src-e4f13850f70c2edd8f1918455575694b72741b3e.tar.gz
Add a new flag (ETHERSWITCH_VID_VALID) to say what vlangroups are in use.
This fix the case when etherswitch is printing the information of port 0 vlan group (in port based vlan mode) with no member ports. Add the ETHERSWITCH_VID_VALID support to ip17x driver. Add the ETHERSWITCH_VID_VALID support to rt8366 driver. arswitch doesn't need to be updated as it doesn't support vlans management yet. Approved by: adrian (mentor)
Diffstat (limited to 'sbin/etherswitchcfg')
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c
index a67dac0..1eef832 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.c
+++ b/sbin/etherswitchcfg/etherswitchcfg.c
@@ -471,8 +471,9 @@ print_vlangroup(struct cfg *cfg, int vlangroup)
vg.es_vlangroup = vlangroup;
if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0)
err(EX_OSERR, "ioctl(IOETHERSWITCHGETVLANGROUP)");
- if (vg.es_vid == 0 && vg.es_member_ports == 0)
+ if ((vg.es_vid & ETHERSWITCH_VID_VALID) == 0)
return;
+ vg.es_vid &= ETHERSWITCH_VID_MASK;
printf("vlangroup%d:\n", vlangroup);
if (cfg->conf.vlan_mode == ETHERSWITCH_VLAN_PORT)
printf("\tport: %d\n", vg.es_vid);
OpenPOWER on IntegriCloud