networkd: Add support to configure proxy ARP and proxy ARP Wifi

This commit is contained in:
Susant Sahani 2019-05-04 20:21:13 +05:30 committed by Yu Watanabe
parent 180f1e3359
commit 1087623bac
6 changed files with 35 additions and 1 deletions

View file

@ -1893,6 +1893,21 @@
When unset, the kernel's default will be used.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>ProxyARP=</varname></term>
<listitem>
<para>Takes a boolean. Configures whether proxy ARP to be enabled on this port.
When unset, the kernel's default will be used.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>ProxyARPWiFi=</varname></term>
<listitem>
<para>Takes a boolean. Configures whether proxy ARP to be enabled on this port
which meets extended requirements by IEEE 802.11 and Hotspot 2.0 specifications.
When unset, the kernel's default will be used.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>Cost=</varname></term>
<listitem>

View file

@ -1592,7 +1592,6 @@ static int link_set_bridge(Link *link) {
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, link->network->allow_port_to_be_root);
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_PROTECT attribute: %m");
}
if (link->network->unicast_flood >= 0) {
@ -1625,6 +1624,18 @@ static int link_set_bridge(Link *link) {
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_LEARNING attribute: %m");
}
if (link->network->bridge_proxy_arp >= 0) {
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROXYARP, link->network->bridge_proxy_arp);
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_PROXYARP attribute: %m");
}
if (link->network->bridge_proxy_arp_wifi >= 0) {
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROXYARP_WIFI, link->network->bridge_proxy_arp_wifi);
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_PROXYARP_WIFI attribute: %m");
}
if (link->network->cost != 0) {
r = sd_netlink_message_append_u32(req, IFLA_BRPORT_COST, link->network->cost);
if (r < 0)

View file

@ -177,6 +177,8 @@ Bridge.MulticastFlood, config_parse_tristate,
Bridge.MulticastToUnicast, config_parse_tristate, 0, offsetof(Network, multicast_to_unicast)
Bridge.NeighborSuppression, config_parse_tristate, 0, offsetof(Network, neighbor_suppression)
Bridge.Learning, config_parse_tristate, 0, offsetof(Network, learning)
Bridge.ProxyARP, config_parse_tristate, 0, offsetof(Network, bridge_proxy_arp)
Bridge.ProxyARPWiFi, config_parse_tristate, 0, offsetof(Network, bridge_proxy_arp_wifi)
Bridge.Priority, config_parse_bridge_port_priority, 0, offsetof(Network, priority)
BridgeFDB.MACAddress, config_parse_fdb_hwaddr, 0, 0
BridgeFDB.VLANId, config_parse_fdb_vlan_id, 0, 0

View file

@ -386,6 +386,8 @@ int network_load_one(Manager *manager, const char *filename) {
.multicast_to_unicast = -1,
.neighbor_suppression = -1,
.learning = -1,
.bridge_proxy_arp = -1,
.bridge_proxy_arp_wifi = -1,
.priority = LINK_BRIDGE_PORT_PRIORITY_INVALID,
.lldp_mode = LLDP_MODE_ROUTERS_ONLY,

View file

@ -181,6 +181,8 @@ struct Network {
int multicast_to_unicast;
int neighbor_suppression;
int learning;
int bridge_proxy_arp;
int bridge_proxy_arp_wifi;
uint32_t cost;
uint16_t priority;

View file

@ -10,6 +10,8 @@ MulticastToUnicast=
MulticastFlood=
NeighborSuppression=
Learning=
ProxyARP=
ProxyARPWiFi=
[Match]
KernelVersion=
Type=