]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: add IPv6ProxyNDP (#5913)
authorHristo Venev <hristo@venev.name>
Tue, 9 May 2017 18:04:55 +0000 (19:04 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 9 May 2017 18:04:55 +0000 (20:04 +0200)
This allows enabling proxy_ndp even if no addresses are configured in
networkd, as well as disabling proxy_ndp from a drop-in.

man/systemd.network.xml
src/network/networkd-ipv6-proxy-ndp.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.c
src/network/networkd-network.h

index 74ee8e56ff764d87cb4c4308028004bed6b6ef16..d02e3b0e60306bd2750de54106df837c585d6f91 100644 (file)
         </para></listitem>
         </varlistentry>
         <varlistentry>
-          <term><varname>IPv6ProxyNDPAddress=</varname></term>
-          <listitem><para>An IPv6 address, for which Neighbour Advertisement
-          messages will be proxied.
-          Proxy NDP (Neighbor Discovery Protocol) is a technique for IPv6 to
-          allow routing of addresses to a different destination when peers expect them
-          to be present on a certain physical link.
+          <term><varname>IPv6ProxyNDP=</varname></term>
+          <listitem><para>A boolean. Configures proxy NDP for IPv6. Proxy NDP (Neighbor Discovery
+          Protocol) is a technique for IPv6 to allow routing of addresses to a different
+          destination when peers expect them to be present on a certain physical link.
           In this case a router answers Neighbour Advertisement messages intended for
           another machine by offering its own MAC address as destination.
-          Unlike proxy ARP for IPv4, is not enabled globally, but will only send Neighbour
+          Unlike proxy ARP for IPv4, it is not enabled globally, but will only send Neighbour
           Advertisement messages for addresses in the IPv6 neighbor proxy table,
-          which can also be shown by <command>ip -6 neighbour show proxy</command>
-          This option may be specified more than once. systemd-networkd will control the
-          per-interface `proxy_ndp` switch for each configured interface, depending on whether
-          there are <option>IPv6ProxyNDPAddress=</option> entries configured and add these to
-          the kernels IPv6 neighbor proxy table.
-          Defaults to unset.
+          which can also be shown by <command>ip -6 neighbour show proxy</command>.
+          systemd-networkd will control the per-interface `proxy_ndp` switch for each configured
+          interface depending on this option.
+          Defautls to unset.
+        </para></listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><varname>IPv6ProxyNDPAddress=</varname></term>
+          <listitem><para>An IPv6 address, for which Neighbour Advertisement messages will be
+          proxied. This option may be specified more than once. systemd-networkd will add the
+          <option>IPv6ProxyNDPAddress=</option> entries to the kernel's IPv6 neighbor proxy table.
+          This option implies <option>IPv6ProxyNDP=true</option> but has no effect if
+          <option>IPv6ProxyNDP</option> has been set to false. Defaults to unset.
         </para></listitem>
         </varlistentry>
         <varlistentry>
index 11c1cd92686cd80c6db0da7a9c74d42d7a28f674..00790c0c135b68fa035b9ee9f352b0282c2b1f76 100644 (file)
@@ -38,6 +38,9 @@ static bool ipv6_proxy_ndp_is_needed(Link *link) {
         if (!link->network)
                 return false;
 
+        if (link->network->ipv6_proxy_ndp != -1)
+                return link->network->ipv6_proxy_ndp;
+
         if (link->network->n_ipv6_proxy_ndp_addresses == 0)
                 return false;
 
index ef53b528a877c6d59ac13efaa68a203692786b54..b2c585f8664d9f5cce9d109cc99425f949a72943 100644 (file)
@@ -63,6 +63,7 @@ Network.IPv6AcceptRA,                   config_parse_tristate,
 Network.IPv6AcceptRouterAdvertisements, config_parse_tristate,                          0,                             offsetof(Network, ipv6_accept_ra)
 Network.IPv6DuplicateAddressDetection,  config_parse_int,                               0,                             offsetof(Network, ipv6_dad_transmits)
 Network.IPv6HopLimit,                   config_parse_int,                               0,                             offsetof(Network, ipv6_hop_limit)
+Network.IPv6ProxyNDP,                   config_parse_tristate,                          0,                             offsetof(Network, ipv6_proxy_ndp)
 Network.ActiveSlave,                    config_parse_bool,                              0,                             offsetof(Network, active_slave)
 Network.PrimarySlave,                   config_parse_bool,                              0,                             offsetof(Network, primary_slave)
 Network.IPv4ProxyARP,                   config_parse_tristate,                          0,                             offsetof(Network, proxy_arp)
index 0c0e6619093f148c9d57fa42f5b79377bf2a9cd6..3c26c8609e81994c6e3b7cab1eafbc95a02b7e1b 100644 (file)
@@ -184,6 +184,7 @@ static int network_load_one(Manager *manager, const char *filename) {
         network->ipv6_accept_ra = -1;
         network->ipv6_dad_transmits = -1;
         network->ipv6_hop_limit = -1;
+        network->ipv6_proxy_ndp = -1;
         network->duid.type = _DUID_TYPE_INVALID;
         network->proxy_arp = -1;
         network->arp = -1;
index 28ef285be6c5db5f9f3de22408ab131134d2bd8a..c9326c7f1e522c861e9494e9277db02e7b80c138 100644 (file)
@@ -178,6 +178,7 @@ struct Network {
         int ipv6_accept_ra;
         int ipv6_dad_transmits;
         int ipv6_hop_limit;
+        int ipv6_proxy_ndp;
         int proxy_arp;
 
         bool ipv6_accept_ra_use_dns;