summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorSusant Sahani <145210+ssahani@users.noreply.github.com>2018-06-01 16:22:12 +0200
committerLennart Poettering <lennart@poettering.net>2018-06-01 16:22:12 +0200
commit866e6b7a1214a8a053615b48bef7be078ff95234 (patch)
treeb8fde1a0bf7c05c846df6ffa474af54d20c4ff39 /src/network
parentMinor spelling error - "Our of"->"Out of" (diff)
downloadsystemd-866e6b7a1214a8a053615b48bef7be078ff95234.tar.xz
systemd-866e6b7a1214a8a053615b48bef7be078ff95234.zip
networkd: enable to set IFF_ALLMULTI to network device (#9146)
networkd: allow setting set IFF_ALLMULTI flag on network devices
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c7
-rw-r--r--src/network/networkd-network-gperf.gperf1
-rw-r--r--src/network/networkd-network.c1
-rw-r--r--src/network/networkd-network.h1
4 files changed, 9 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 32bcc4c459..c957efd409 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 && link->network->multicast < 0)
+ if (link->network->arp < 0 && link->network->multicast < 0 && link->network->allmulticast < 0)
return 0;
r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex);
@@ -1374,6 +1374,11 @@ static int link_set_flags(Link *link) {
SET_FLAG(ifi_flags, IFF_MULTICAST, link->network->multicast);
}
+ if (link->network->allmulticast >= 0) {
+ ifi_change |= IFF_ALLMULTI;
+ SET_FLAG(ifi_flags, IFF_ALLMULTI, link->network->allmulticast);
+ }
+
r = sd_rtnl_message_link_set_flags(req, ifi_flags, ifi_change);
if (r < 0)
return log_link_error_errno(link, r, "Could not set link flags: %m");
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 26e3f452ef..7e625e48fa 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -34,6 +34,7 @@ Link.MACAddress, config_parse_hwaddr,
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.AllMulticast, config_parse_tristate, 0, offsetof(Network, allmulticast)
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 57d04827ab..c3a11ddca0 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -248,6 +248,7 @@ static int network_load_one(Manager *manager, const char *filename) {
network->proxy_arp = -1;
network->arp = -1;
network->multicast = -1;
+ network->allmulticast = -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 86e97909c9..b8e2c523a3 100644
--- a/src/network/networkd-network.h
+++ b/src/network/networkd-network.h
@@ -214,6 +214,7 @@ struct Network {
uint32_t mtu;
int arp;
int multicast;
+ int allmulticast;
bool unmanaged;
bool configure_without_carrier;
uint32_t iaid;