netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch iproute2] iptunnel: check SIT_ISATAP flag only for SIT tunnel
@ 2013-07-02  9:39 Cong Wang
  2013-07-09 16:09 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Cong Wang @ 2013-07-02  9:39 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Cong Wang

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>

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch iproute2] iptunnel: check SIT_ISATAP flag only for SIT tunnel
  2013-07-02  9:39 [Patch iproute2] iptunnel: check SIT_ISATAP flag only for SIT tunnel Cong Wang
@ 2013-07-09 16:09 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2013-07-09 16:09 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-09 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02  9:39 [Patch iproute2] iptunnel: check SIT_ISATAP flag only for SIT tunnel Cong Wang
2013-07-09 16:09 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).