]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip/ip6tunnel: fix update of tclass and flowlabel
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Wed, 14 Nov 2012 15:29:26 +0000 (16:29 +0100)
committerStephen Hemminger <shemminger@vyatta.com>
Fri, 16 Nov 2012 16:15:39 +0000 (08:15 -0800)
When tclass or flowlabel field were updated, we only performed an OR with the
new value. For example, it was not possible to reset tclass:
  ip -6 tunnel change ip6tnl2 tclass 0

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
ip/ip6tunnel.c

index 7aaac61b3a53a53efad9643c52c5d40b48e12bf3..fcc9f33c603c4306fabd59c06a891e09529d4f30 100644 (file)
@@ -173,6 +173,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm *p)
                           matches(*argv, "dsfield") == 0) {
                        __u8 uval;
                        NEXT_ARG();
+                       p->flowinfo &= ~IP6_FLOWINFO_TCLASS;
                        if (strcmp(*argv, "inherit") == 0)
                                p->flags |= IP6_TNL_F_USE_ORIG_TCLASS;
                        else {
@@ -185,6 +186,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm *p)
                           strcmp(*argv, "fl") == 0) {
                        __u32 uval;
                        NEXT_ARG();
+                       p->flowinfo &= ~IP6_FLOWINFO_FLOWLABEL;
                        if (strcmp(*argv, "inherit") == 0)
                                p->flags |= IP6_TNL_F_USE_ORIG_FLOWLABEL;
                        else {