From patchwork Tue Jul 2 09:39:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amerigo Wang X-Patchwork-Id: 256308 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3BD382C0077 for ; Tue, 2 Jul 2013 19:39:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932623Ab3GBJjm (ORCPT ); Tue, 2 Jul 2013 05:39:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932250Ab3GBJjk (ORCPT ); Tue, 2 Jul 2013 05:39:40 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r629dcoP000587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Jul 2013 05:39:38 -0400 Received: from localhost.localdomain (vpn1-112-203.nay.redhat.com [10.66.112.203]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r629dZGr009166; Tue, 2 Jul 2013 05:39:36 -0400 From: Cong Wang To: netdev@vger.kernel.org Cc: Stephen Hemminger , Cong Wang Subject: [Patch iproute2] iptunnel: check SIT_ISATAP flag only for SIT tunnel Date: Tue, 2 Jul 2013 17:39:28 +0800 Message-Id: <1372757968-21236-1-git-send-email-amwang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: Cong Wang --- -- 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 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;