diff options
-rw-r--r-- | man/systemd.network.xml | 6 | ||||
-rw-r--r-- | src/network/networkd-link.c | 9 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 1 | ||||
-rw-r--r-- | src/network/networkd-network.c | 1 | ||||
-rw-r--r-- | src/network/networkd-network.h | 1 |
5 files changed, 16 insertions, 2 deletions
diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 82629b9172..64b9232689 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -243,6 +243,12 @@ </listitem> </varlistentry> <varlistentry> + <term><varname>Multicast=</varname></term> + <listitem> + <para> A boolean. Enables or disables the change the MULTICAST flag on the device.</para> + </listitem> + </varlistentry> + <varlistentry> <term><varname>Unmanaged=</varname></term> <listitem> <para>A boolean. When <literal>yes</literal>, no attempts are diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 8cc817ac00..32bcc4c459 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1357,7 +1357,7 @@ static int link_set_flags(Link *link) { if (!link->network) return 0; - if (link->network->arp < 0) + if (link->network->arp < 0 && link->network->multicast < 0) return 0; r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex); @@ -1366,7 +1366,12 @@ static int link_set_flags(Link *link) { if (link->network->arp >= 0) { ifi_change |= IFF_NOARP; - ifi_flags |= link->network->arp ? 0 : IFF_NOARP; + SET_FLAG(ifi_flags, IFF_NOARP, link->network->arp == 0); + } + + if (link->network->multicast >= 0) { + ifi_change |= IFF_MULTICAST; + SET_FLAG(ifi_flags, IFF_MULTICAST, link->network->multicast); } r = sd_rtnl_message_link_set_flags(req, ifi_flags, ifi_change); diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 23f57ca2f0..26e3f452ef 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -33,6 +33,7 @@ Match.Architecture, config_parse_net_condition, Link.MACAddress, config_parse_hwaddr, 0, offsetof(Network, mac) Link.MTUBytes, config_parse_mtu, AF_UNSPEC, offsetof(Network, mtu) Link.ARP, config_parse_tristate, 0, offsetof(Network, arp) +Link.Multicast, config_parse_tristate, 0, offsetof(Network, multicast) Link.Unmanaged, config_parse_bool, 0, offsetof(Network, unmanaged) Link.RequiredForOnline, config_parse_bool, 0, offsetof(Network, required_for_online) Network.Description, config_parse_string, 0, offsetof(Network, description) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 2b03fc254b..57d04827ab 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -247,6 +247,7 @@ static int network_load_one(Manager *manager, const char *filename) { network->duid.type = _DUID_TYPE_INVALID; network->proxy_arp = -1; network->arp = -1; + network->multicast = -1; network->ipv6_accept_ra_use_dns = true; network->ipv6_accept_ra_route_table = RT_TABLE_MAIN; network->ipv6_mtu = 0; diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index c4c6b28ab0..86e97909c9 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -213,6 +213,7 @@ struct Network { struct ether_addr *mac; uint32_t mtu; int arp; + int multicast; bool unmanaged; bool configure_without_carrier; uint32_t iaid; |