diff options
author | Susant Sahani <susant@redhat.com> | 2018-05-29 16:58:11 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-05-30 12:59:24 +0200 |
commit | e6ebebbe6aef5830793af515c2e3a998bde920b9 (patch) | |
tree | a8b755d810d601e6d4774fc610ca6c14740cce4a /src/network | |
parent | po: update French translation (diff) | |
download | systemd-e6ebebbe6aef5830793af515c2e3a998bde920b9.tar.xz systemd-e6ebebbe6aef5830793af515c2e3a998bde920b9.zip |
networkd: Add ability to set MULTICAST flag on interface
Closes #9113
fix ARP toggling flag
Diffstat (limited to 'src/network')
-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 |
4 files changed, 10 insertions, 2 deletions
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; |