]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
gre,ip6tnl/tunnel: Fix noencap- support
authorSerhey Popovych <serhe.popovych@gmail.com>
Wed, 27 Dec 2017 11:28:14 +0000 (13:28 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 27 Dec 2017 21:41:42 +0000 (13:41 -0800)
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>
ip/link_gre.c
ip/link_ip6tnl.c

index f55c40c71a68f0d49890179bd11e01f36153a47e..896bb19ab4711e839611e9db0d7f6086db290b10 100644 (file)
@@ -281,11 +281,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) {
index 0a471c2d988089fb2838363e31768c20b33d559d..84205b1204ccbfd15a7d7e85aa58f923f00a4166 100644 (file)
@@ -301,7 +301,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