Skip to content

Commit

Permalink
confd: always create bridge with default_pvid 0
Browse files Browse the repository at this point in the history
Fix #310
  • Loading branch information
troglobit authored and wkz committed Feb 26, 2024
1 parent f1ab05a commit 83821de
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/confd/src/ietf-interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,14 @@ static int netdag_gen_bridge(struct dagger *net, struct lyd_node *dif,
mcast_snooping = 0; /* Not supported yet */
fwd_mask = bridge_fwd_mask(cif);

fprintf(ip, "link %s dev %s type bridge group_fwd_mask %d vlan_filtering %d mcast_snooping %d",
/*
* Issue #198: we require explicit VLAN assignment for ports
* when VLAN filtering is enabled. We strongly
* believe this is the only sane way of doing it.
* Issue #310: malplaced 'vlan_default_pvid 0'
*/
fprintf(ip, "link %s dev %s type bridge group_fwd_mask %d vlan_filtering %d"
" vlan_default_pvid 0 mcast_snooping %d",
op, brname, fwd_mask, vlan_filtering ? 1 : 0, mcast_snooping ? 1 : 0);
if (!vlan_filtering) {
fputc('\n', ip);
Expand All @@ -907,12 +914,7 @@ static int netdag_gen_bridge(struct dagger *net, struct lyd_node *dif,
goto done;
}

/*
* Issue #198: we require explicit VLAN assignment for ports
* when VLAN filtering is enabled. We strongly
* believe this is the only sane way of doing it.
*/
fprintf(ip, " vlan_protocol %s vlan_default_pvid 0\n", proto);
fprintf(ip, " vlan_protocol %s\n", proto);

vlans = lydx_get_descendant(lyd_child(dif), "bridge", "vlans", NULL);
if (!vlans)
Expand Down

0 comments on commit 83821de

Please sign in to comment.