1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

networkd: bridge add support to configure multicast snooping (#3223)

This patch implements support for the IFLA_BR_MCAST_SNOOPING attribute
it can change the multicast snooping value.

IGMP snooping monitors the Internet Group Management Protocol (IGMP)
traffic between hosts and multicast routers.
This commit is contained in:
Susant Sahani 2016-05-15 18:45:20 +05:30 committed by Zbigniew Jędrzejewski-Szmek
parent 17fd746098
commit 6df6d89879
4 changed files with 18 additions and 0 deletions

View File

@ -321,6 +321,15 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>MulticastSnooping=</varname></term>
<listitem>
<para>A boolean. This setting controls the IFLA_BR_MCAST_SNOOPING option in the kernel.
If enabled, IGMP snooping monitors the Internet Group Management Protocol (IGMP) traffic
between hosts and multicast routers. When unset, the kernel's default setting applies.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -96,6 +96,12 @@ static int netdev_bridge_post_create(NetDev *netdev, Link *link, sd_netlink_mess
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BR_MCAST_QUERIER attribute: %m");
}
if (b->mcast_snooping >= 0) {
r = sd_netlink_message_append_u8(req, IFLA_BR_MCAST_SNOOPING, b->mcast_snooping);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BR_MCAST_SNOOPING attribute: %m");
}
r = sd_netlink_message_close_container(req);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_LINKINFO attribute: %m");
@ -121,6 +127,7 @@ static void bridge_init(NetDev *n) {
assert(b);
b->mcast_querier = -1;
b->mcast_snooping = -1;
}
const NetDevVTable bridge_vtable = {

View File

@ -25,6 +25,7 @@ typedef struct Bridge {
NetDev meta;
int mcast_querier;
int mcast_snooping;
usec_t forward_delay;
usec_t hello_time;

View File

@ -99,3 +99,4 @@ Bridge.HelloTimeSec, config_parse_sec, 0,
Bridge.MaxAgeSec, config_parse_sec, 0, offsetof(Bridge, max_age)
Bridge.ForwardDelaySec, config_parse_sec, 0, offsetof(Bridge, forward_delay)
Bridge.MulticastQuerier, config_parse_tristate, 0, offsetof(Bridge, mcast_querier)
Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping)