Skip to content

Commit

Permalink
confd: set mcast_vlan_snooping and correct IGMP/MLD versions
Browse files Browse the repository at this point in the history
As described in issue #396, multicast filtering on VLAN filtering
bridges did not work at all.  This because bridge_mcast_settings()
exited when no global multicast settings were found -- a change to
the YANG model made previously triggered this fauled behavior.

Also, the initial IGMP/MLD versions were set to 2/1 (kernel default)
instead of 3/2 (Infix default).

Fixes #396

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Apr 28, 2024
1 parent ca6349a commit c6e8faf
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/confd/src/ietf-interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,9 @@ static int vlan_mcast_settings(sr_session_ctx_t *session, FILE *br, const char *
snooping = lydx_is_enabled(mcast, "snooping");
querier = querier_mode(lydx_get_cattr(mcast, "querier"));

fprintf(br, "vlan global set vid %d dev %s mcast_snooping %d\n",
fprintf(br, "vlan global set vid %d dev %s mcast_snooping %d",
vid, brname, snooping);
fprintf(br, " mcast_igmp_version 3 mcast_mld_version 2\n");

interval = atoi(lydx_get_cattr(mcast, "query-interval"));
ifname = find_vlan_interface(session, brname, vid);
Expand All @@ -1139,27 +1140,29 @@ static int vlan_mcast_settings(sr_session_ctx_t *session, FILE *br, const char *
return 0;
}

static int bridge_mcast_settings(FILE *ip, const char *brname, struct lyd_node *cif, int vlan_filtering)
static int bridge_mcast_settings(FILE *ip, const char *brname, struct lyd_node *cif, int vlan_mcast)
{
int interval, querier, snooping;
struct lyd_node *mcast;

mcast = lydx_get_descendant(lyd_child(cif), "bridge", "multicast", NULL);
if (!mcast) {
mcast_querier(brname, 0, 0, 0);
return 0;
interval = snooping = querier = 0;
} else {
snooping = lydx_is_enabled(mcast, "snooping");
querier = querier_mode(lydx_get_cattr(mcast, "querier"));
interval = atoi(lydx_get_cattr(mcast, "query-interval"));
}

snooping = lydx_is_enabled(mcast, "snooping");
querier = querier_mode(lydx_get_cattr(mcast, "querier"));

fprintf(ip, " mcast_vlan_snooping %d", vlan_filtering ? snooping : 0);
fprintf(ip, " mcast_snooping %d mcast_querier 0", snooping);

interval = atoi(lydx_get_cattr(mcast, "query-interval"));
fprintf(ip, " mcast_query_interval %d", interval * 100);
fprintf(ip, " mcast_vlan_snooping %d", vlan_mcast ? 1 : 0);
fprintf(ip, " mcast_snooping %d mcast_querier 0", vlan_mcast ? 1 : snooping);
if (snooping)
fprintf(ip, " mcast_igmp_version 3 mcast_mld_version 2");
if (interval)
fprintf(ip, " mcast_query_interval %d", interval * 100);

if (!vlan_filtering)
if (!vlan_mcast)
mcast_querier(brname, 0, querier, interval);
else
mcast_querier(brname, 0, 0, 0);
Expand Down

0 comments on commit c6e8faf

Please sign in to comment.