summaryrefslogtreecommitdiff
path: root/system-linux.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-01-24 13:21:44 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-01-24 13:21:44 +0100
commitaf3cadb6a46ba93e8a729e71d82b176275931e62 (patch)
tree009b49da2953a40abfb6819d5806c6ef0023a333 /system-linux.c
parentfd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1 (diff)
downloadnetifd-af3cadb6a46ba93e8a729e71d82b176275931e62.tar.gz
system-linux: VXLAN: add options to enable and disable UDP checksums
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/system-linux.c b/system-linux.c
index 32d6ffc..0277886 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -2841,6 +2841,17 @@ static int system_add_vxlan(const char *name, const unsigned int link, struct bl
}
nla_put_u16(msg, IFLA_VXLAN_PORT, htons(port));
+ if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
+ bool rxcsum = blobmsg_get_bool(cur);
+ nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, !rxcsum);
+ }
+
+ if ((cur = tb_data[VXLAN_DATA_ATTR_TXCSUM])) {
+ bool txcsum = blobmsg_get_bool(cur);
+ nla_put_u8(msg, IFLA_VXLAN_UDP_CSUM, txcsum);
+ nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, !txcsum);
+ }
+
if ((cur = tb[TUNNEL_ATTR_TOS])) {
char *str = blobmsg_get_string(cur);
unsigned tos = 1;