networkd: Add ability to set MULTICAST flag on interface

Closes #9113

fix ARP toggling flag
This commit is contained in:
Susant Sahani 2018-05-29 20:28:11 +05:30 committed by Lennart Poettering
parent 714f8d3c37
commit e6ebebbe6a
5 changed files with 16 additions and 2 deletions

View File

@ -242,6 +242,12 @@
the network otherwise.</para>
</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>

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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;