Patchwork [iproute2] iptunnel: check SIT_ISATAP flag only for SIT tunnel

login
register
mail settings
Submitter Amerigo Wang
Date July 2, 2013, 9:39 a.m.
Message ID <1372757968-21236-1-git-send-email-amwang@redhat.com>
Download mbox | patch
Permalink /patch/256308/
State Accepted
Delegated to: stephen hemminger
Headers show

Comments

Amerigo Wang - July 2, 2013, 9:39 a.m.
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>

---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - July 9, 2013, 4:09 p.m.
On Tue,  2 Jul 2013 17:39:28 +0800
Cong Wang <amwang@redhat.com> wrote:

> 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>

Applied
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 4275f26..43f8585 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -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;