]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iptunnel: check SIT_ISATAP flag only for SIT tunnel
authorAmerigo Wang <amwang@redhat.com>
Tue, 2 Jul 2013 09:39:28 +0000 (17:39 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 9 Jul 2013 16:08:14 +0000 (09:08 -0700)
Without patch, I got:

# ./ip/ip tunnel show
ip_vti0: ioctl 89f4 failed: Invalid argument
ip_vti0: ip/ip  remote any  local any  ttl inherit  nopmtudisc key 0

this is due to VTI_ISVTI has the same numeric value with SIT_ISATAP,
but only sit tunnel has SIOCGETPRL, therefore it should check for SIT
tunnel first.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <amwang@redhat.com>
ip/iptunnel.c

index 4275f2603814863e4ce84222112f8af69214279a..43f858556465ada0003a8753f3c43f83b27d14a9 100644 (file)
@@ -341,7 +341,7 @@ static void print_tunnel(struct ip_tunnel_parm *p)
               p->iph.daddr ? format_host(AF_INET, 4, &p->iph.daddr, s1, sizeof(s1))  : "any",
               p->iph.saddr ? rt_addr_n2a(AF_INET, 4, &p->iph.saddr, s2, sizeof(s2)) : "any");
 
-       if (p->i_flags & SIT_ISATAP) {
+       if (p->iph.protocol == IPPROTO_IPV6 && (p->i_flags & SIT_ISATAP)) {
                struct ip_tunnel_prl prl[16];
                int i;