]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd vxlan: Add support for enabling UDP checksums
authorSusant Sahani <susant@redhat.com>
Thu, 5 Mar 2015 16:32:47 +0000 (22:02 +0530)
committerTom Gundersen <teg@jklm.no>
Mon, 20 Apr 2015 18:09:32 +0000 (20:09 +0200)
Add UDPCheckSum option to enable transmitting UDP checksums when doing
VXLAN/IPv4. Add UDP6ZeroChecksumRx, and UDP6ZeroChecksumTx
options to enable sending zero checksums and receiving zero
checksums in VXLAN/IPv6

[tomegun: rebase manpage due to whitespace changes]

man/systemd.netdev.xml
src/network/networkd-netdev-gperf.gperf
src/network/networkd-netdev-vxlan.c
src/network/networkd-netdev-vxlan.h

index ef58887dc8881fc60089fcbb46e43aa70cf2f75b..fc2968594dead34bf41327abd3260a0390d9f0e8 100644 (file)
           on.</para>
         </listitem>
       </varlistentry>
+      <varlistentry>
+        <term><varname>UDPCheckSum=</varname></term>
+        <listitem>
+          <para>A boolean. When true transmitting UDP checksums when doing VXLAN/IPv4 is turned on.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>UDP6ZeroChecksumTx=</varname></term>
+        <listitem>
+          <para>A boolean. When true sending zero checksums in VXLAN/IPv6 is turned on.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><varname>UDP6ZeroCheckSumRx=</varname></term>
+        <listitem>
+          <para>A boolean. When true receiving zero checksums in VXLAN/IPv6 is turned on.</para>
+        </listitem>
+      </varlistentry>
     </variablelist>
   </refsect1>
   <refsect1>
index 963c47c3e5990f9af076aa23bc86179baaf686ef..c06344c397a9b62c6a5b7267360f73aaa8840c8d 100644 (file)
@@ -47,6 +47,9 @@ VXLAN.ARPProxy,           config_parse_bool,                  0,
 VXLAN.L2MissNotification, config_parse_bool,                  0,                             offsetof(VxLan, l2miss)
 VXLAN.L3MissNotification, config_parse_bool,                  0,                             offsetof(VxLan, l3miss)
 VXLAN.RouteShortCircuit,  config_parse_bool,                  0,                             offsetof(VxLan, route_short_circuit)
+VXLAN.UDPCheckSum,        config_parse_bool,                  0,                             offsetof(VxLan, udpcsum)
+VXLAN.UDP6ZeroCheckSumRx, config_parse_bool,                  0,                             offsetof(VxLan, udp6zerocsumrx)
+VXLAN.UDP6ZeroCheckSumTx, config_parse_bool,                  0,                             offsetof(VxLan, udp6zerocsumtx)
 VXLAN.FDBAgeingSec,       config_parse_sec,                   0,                             offsetof(VxLan, fdb_ageing)
 Tun.OneQueue,             config_parse_bool,                  0,                             offsetof(TunTap, one_queue)
 Tun.MultiQueue,           config_parse_bool,                  0,                             offsetof(TunTap, multi_queue)
index 4a3a51104f1a7ec79e995b81bf0542f9ca19d8e6..e2c2b108b9d08c8b7b00907f8de0fbc2790c0982 100644 (file)
@@ -133,6 +133,30 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_
                 }
         }
 
+        r = sd_rtnl_message_append_u8(m, IFLA_VXLAN_UDP_CSUM, v->udpcsum);
+        if (r < 0) {
+                log_netdev_error(netdev,
+                                 "Could not append IFLA_VXLAN_UDP_CSUM attribute: %s",
+                                 strerror(-r));
+                return r;
+        }
+
+        r = sd_rtnl_message_append_u8(m, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, v->udp6zerocsumtx);
+        if (r < 0) {
+                log_netdev_error(netdev,
+                                 "Could not append IFLA_VXLAN_UDP_ZERO_CSUM6_TX attribute: %s",
+                                 strerror(-r));
+                return r;
+        }
+
+        r = sd_rtnl_message_append_u8(m, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, v->udp6zerocsumrx);
+        if (r < 0) {
+                log_netdev_error(netdev,
+                                 "Could not append IFLA_VXLAN_UDP_ZERO_CSUM6_RX attribute: %s",
+                                 strerror(-r));
+                return r;
+        }
+
         return r;
 }
 
@@ -197,6 +221,9 @@ static void vxlan_init(NetDev *netdev) {
 
         v->id = VXLAN_VID_MAX + 1;
         v->learning = true;
+        v->udpcsum = false;
+        v->udp6zerocsumtx = false;
+        v->udp6zerocsumrx = false;
 }
 
 const NetDevVTable vxlan_vtable = {
index 6339af9add776680d246d0cba3c1e356d6b5a7d1..fe5254e91ff6523d15da59c5dcccd00689830f4f 100644 (file)
@@ -47,6 +47,9 @@ struct VxLan {
         bool route_short_circuit;
         bool l2miss;
         bool l3miss;
+        bool udpcsum;
+        bool udp6zerocsumtx;
+        bool udp6zerocsumrx;
 };
 
 extern const NetDevVTable vxlan_vtable;