summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c8
-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, 10 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index b7047c06d1..7675f266e5 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1108,7 +1108,8 @@ static int link_set_flags(Link *link) {
if (!link->network)
return 0;
- if (link->network->arp < 0 && link->network->multicast < 0 && link->network->allmulticast < 0)
+ if (link->network->arp < 0 && link->network->multicast < 0 && link->network->allmulticast < 0 &&
+ link->network->promiscuous < 0)
return 0;
r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex);
@@ -1130,6 +1131,11 @@ static int link_set_flags(Link *link) {
SET_FLAG(ifi_flags, IFF_ALLMULTI, link->network->allmulticast);
}
+ if (link->network->promiscuous >= 0) {
+ ifi_change |= IFF_PROMISC;
+ SET_FLAG(ifi_flags, IFF_PROMISC, link->network->promiscuous);
+ }
+
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 619c6a8c59..be7c076c61 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -62,6 +62,7 @@ Link.Group, config_parse_uint32,
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.Promiscuous, config_parse_tristate, 0, offsetof(Network, promiscuous)
Link.Unmanaged, config_parse_bool, 0, offsetof(Network, unmanaged)
Link.RequiredForOnline, config_parse_required_for_online, 0, 0
SR-IOV.VirtualFunction, config_parse_sr_iov_uint32, 0, 0
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 73c3788e27..a5440a83c7 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -321,6 +321,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
.arp = -1,
.multicast = -1,
.allmulticast = -1,
+ .promiscuous = -1,
.configure_without_carrier = false,
.ignore_carrier_loss = -1,
diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h
index 17e7d432c9..a23de93126 100644
--- a/src/network/networkd-network.h
+++ b/src/network/networkd-network.h
@@ -87,6 +87,7 @@ struct Network {
int arp;
int multicast;
int allmulticast;
+ int promiscuous;
bool unmanaged;
bool required_for_online; /* Is this network required to be considered online? */
LinkOperationalStateRange required_operstate_for_online;