From 4cc0fd7531bd761f5fc4415b95bcc1dcd9d72e6f Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Tue, 7 May 2019 00:40:57 +0530 Subject: [PATCH] networkd: VXLAN add support to configure Generic Protocol Extension See https://tools.ietf.org/html/draft-ietf-nvo3-vxlan-gpe-07 --- man/systemd.netdev.xml | 9 +++++++++ src/network/netdev/netdev-gperf.gperf | 1 + src/network/netdev/vxlan.c | 6 ++++++ src/network/netdev/vxlan.h | 1 + test/fuzz/fuzz-netdev-parser/directives.netdev | 1 + 5 files changed, 18 insertions(+) diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 1f2f4bd9c88..7fddedf6e8f 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -655,6 +655,15 @@ VXLAN Group Policy document. Defaults to false. + + GenericProtocolExtension= + + Takes a boolean. When true, Generic Protocol Extension extends the existing VXLAN protocol + to provide protocol typing, OAM, and versioning capabilities. For details about the VXLAN GPE + Header, see the + Generic Protocol Extension for VXLAN document. Defaults to false. + + DestinationPort= diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index e71c9d00daa..10bd334d4bf 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -119,6 +119,7 @@ VXLAN.RemoteChecksumTx, config_parse_bool, VXLAN.RemoteChecksumRx, config_parse_bool, 0, offsetof(VxLan, remote_csum_rx) VXLAN.FDBAgeingSec, config_parse_sec, 0, offsetof(VxLan, fdb_ageing) VXLAN.GroupPolicyExtension, config_parse_bool, 0, offsetof(VxLan, group_policy) +VXLAN.GenericProtocolExtension, config_parse_bool, 0, offsetof(VxLan, generic_protocol_extension) VXLAN.MaximumFDBEntries, config_parse_unsigned, 0, offsetof(VxLan, max_fdb) VXLAN.PortRange, config_parse_port_range, 0, 0 VXLAN.DestinationPort, config_parse_ip_port, 0, offsetof(VxLan, dest_port) diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c index 8fa6e87d923..86403696a01 100644 --- a/src/network/netdev/vxlan.c +++ b/src/network/netdev/vxlan.c @@ -144,6 +144,12 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_GBP attribute: %m"); } + if (v->generic_protocol_extension) { + r = sd_netlink_message_append_flag(m, IFLA_VXLAN_GPE); + if (r < 0) + return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_GPE attribute: %m"); + } + return r; } diff --git a/src/network/netdev/vxlan.h b/src/network/netdev/vxlan.h index 03716f6f895..c2dbfaf2029 100644 --- a/src/network/netdev/vxlan.h +++ b/src/network/netdev/vxlan.h @@ -42,6 +42,7 @@ struct VxLan { bool remote_csum_tx; bool remote_csum_rx; bool group_policy; + bool generic_protocol_extension; struct ifla_vxlan_port_range port_range; }; diff --git a/test/fuzz/fuzz-netdev-parser/directives.netdev b/test/fuzz/fuzz-netdev-parser/directives.netdev index 0d0bd2c85b2..5aa5e9283d3 100644 --- a/test/fuzz/fuzz-netdev-parser/directives.netdev +++ b/test/fuzz/fuzz-netdev-parser/directives.netdev @@ -101,6 +101,7 @@ UDP6ZeroChecksumTx= UDP6ZeroCheckSumRx= UDPCheckSum= GroupPolicyExtension= +GenericProtocolExtension= MaximumFDBEntries= TTL= DestinationPort=