From patchwork Fri Sep 13 02:59:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Duan Jiong X-Patchwork-Id: 274630 X-Patchwork-Delegate: davem@davemloft.net 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 3F5B02C00AC for ; Fri, 13 Sep 2013 13:00:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753023Ab3IMDAl (ORCPT ); Thu, 12 Sep 2013 23:00:41 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:41364 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751418Ab3IMDAj (ORCPT ); Thu, 12 Sep 2013 23:00:39 -0400 X-IronPort-AV: E=Sophos;i="4.90,895,1371052800"; d="scan'208";a="8511265" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 13 Sep 2013 10:57:28 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r8D30a10021356; Fri, 13 Sep 2013 11:00:37 +0800 Received: from [10.167.225.86] ([10.167.225.86]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013091310581482-1479058 ; Fri, 13 Sep 2013 10:58:14 +0800 Message-ID: <52327F9F.6080003@cn.fujitsu.com> Date: Fri, 13 Sep 2013 10:59:43 +0800 From: Duan Jiong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130612 Thunderbird/17.0.6 MIME-Version: 1.0 To: davem@davemloft.net CC: netdev@vger.kernel.org, hannes@stressinduktion.org Subject: [PATCH v2 2/6] ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle References: <52327F00.4040802@cn.fujitsu.com> In-Reply-To: <52327F00.4040802@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/09/13 10:58:14, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/09/13 10:58:15, Serialize complete at 2013/09/13 10:58:15 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Duan Jiong we don't handle NDISC_REDIRECTs here any more, and the match on ICMPV6_DEST_UNREACH is meaningless. Signed-off-by: Duan Jiong --- net/ipv6/ah6.c | 9 ++------- net/ipv6/esp6.c | 9 ++------- net/ipv6/ipcomp6.c | 9 ++------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 73784c3..79fb40f 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c @@ -618,19 +618,14 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset); struct xfrm_state *x; - if (type != ICMPV6_DEST_UNREACH && - type != ICMPV6_PKT_TOOBIG && - type != NDISC_REDIRECT) + if (type != ICMPV6_PKT_TOOBIG) return; x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET6); if (!x) return; - if (type == NDISC_REDIRECT) - ip6_redirect(skb, net, skb->dev->ifindex, 0); - else - ip6_update_pmtu(skb, net, info, 0, 0); + ip6_update_pmtu(skb, net, info, 0, 0); xfrm_state_put(x); } diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index d3618a7..6aa64e1 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -436,9 +436,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data + offset); struct xfrm_state *x; - if (type != ICMPV6_DEST_UNREACH && - type != ICMPV6_PKT_TOOBIG && - type != NDISC_REDIRECT) + if (type != ICMPV6_PKT_TOOBIG) return; x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr, @@ -446,10 +444,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, if (!x) return; - if (type == NDISC_REDIRECT) - ip6_redirect(skb, net, skb->dev->ifindex, 0); - else - ip6_update_pmtu(skb, net, info, 0, 0); + ip6_update_pmtu(skb, net, info, 0, 0); xfrm_state_put(x); } diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 5636a91..e943158 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c @@ -64,9 +64,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, (struct ip_comp_hdr *)(skb->data + offset); struct xfrm_state *x; - if (type != ICMPV6_DEST_UNREACH && - type != ICMPV6_PKT_TOOBIG && - type != NDISC_REDIRECT) + if (type != ICMPV6_PKT_TOOBIG) return; spi = htonl(ntohs(ipcomph->cpi)); @@ -75,10 +73,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, if (!x) return; - if (type == NDISC_REDIRECT) - ip6_redirect(skb, net, skb->dev->ifindex, 0); - else - ip6_update_pmtu(skb, net, info, 0, 0); + ip6_update_pmtu(skb, net, info, 0, 0); xfrm_state_put(x); }