From 6272585e2488954fcfe6694f51fc22f9fd21ebf6 Mon Sep 17 00:00:00 2001
From: Serhey Popovych <serhe.popovych@gmail.com>
Date: Wed, 27 Dec 2017 13:28:14 +0200
Subject: [PATCH] gre,ip6tnl/tunnel: Fix noencap- support
We must clear bit, not set all but given bit.
Fixes: 858dbb208e39 ("ip link: Add support for remote checksum offload to IP tunnels")
Fixes: 73516e128a5a ("ip6tnl: Support for fou encapsulation"
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
(cherry picked from commit 147ade01b036aa0b4d6041ea0ef92608a4ded72c)
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
ip/link_gre.c | 4 ++--
ip/link_ip6tnl.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ip/link_gre.c b/ip/link_gre.c
index 9ea2970cadc24..72d172a43bfa6 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -315,11 +315,11 @@ get_failed:
} else if (strcmp(*argv, "encap-udp6-csum") == 0) {
encapflags |= TUNNEL_ENCAP_FLAG_CSUM6;
} else if (strcmp(*argv, "noencap-udp6-csum") == 0) {
- encapflags |= ~TUNNEL_ENCAP_FLAG_CSUM6;
+ encapflags &= ~TUNNEL_ENCAP_FLAG_CSUM6;
} else if (strcmp(*argv, "encap-remcsum") == 0) {
encapflags |= TUNNEL_ENCAP_FLAG_REMCSUM;
} else if (strcmp(*argv, "noencap-remcsum") == 0) {
- encapflags |= ~TUNNEL_ENCAP_FLAG_REMCSUM;
+ encapflags &= ~TUNNEL_ENCAP_FLAG_REMCSUM;
} else if (strcmp(*argv, "external") == 0) {
metadata = 1;
} else if (strcmp(*argv, "ignore-df") == 0) {
diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c
index a41990068f0f7..3e92748c9a0aa 100644
--- a/ip/link_ip6tnl.c
+++ b/ip/link_ip6tnl.c
@@ -298,7 +298,7 @@ get_failed:
} else if (strcmp(*argv, "encap-remcsum") == 0) {
encapflags |= TUNNEL_ENCAP_FLAG_REMCSUM;
} else if (strcmp(*argv, "noencap-remcsum") == 0) {
- encapflags |= ~TUNNEL_ENCAP_FLAG_REMCSUM;
+ encapflags &= ~TUNNEL_ENCAP_FLAG_REMCSUM;
} else if (strcmp(*argv, "external") == 0) {
metadata = 1;
} else
--
2.15.1