From: Duan Jiong <duanj.fnst@cn•fujitsu.com>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, hannes@stressinduktion•org
Subject: [PATCH v2 1/6] ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err
Date: Fri, 13 Sep 2013 10:58:55 +0800 [thread overview]
Message-ID: <52327F6F.8050508@cn.fujitsu.com> (raw)
In-Reply-To: <52327F00.4040802@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn•fujitsu.com>
Because we will do route updating for redirect in nidsc layer. And
when dealing with redirect message, the dccp and sctp should like
tcp return directly.
Signed-off-by: Duan Jiong <duanj.fnst@cn•fujitsu.com>
---
net/dccp/ipv6.c | 10 +++-------
net/ipv6/tcp_ipv6.c | 12 ++++--------
net/sctp/input.c | 12 ------------
net/sctp/ipv6.c | 6 +++---
4 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 9c61f9c..300840c 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -98,6 +98,9 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
return;
}
+ if (type == NDISC_REDIRECT)
+ return;
+
sk = inet6_lookup(net, &dccp_hashinfo,
&hdr->daddr, dh->dccph_dport,
&hdr->saddr, dh->dccph_sport, inet6_iif(skb));
@@ -130,13 +133,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
np = inet6_sk(sk);
- if (type == NDISC_REDIRECT) {
- struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
-
- if (dst)
- dst->ops->redirect(dst, sk, skb);
- }
-
if (type == ICMPV6_PKT_TOOBIG) {
struct dst_entry *dst = NULL;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5c71501..d3ca8a4 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -346,6 +346,10 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
__u32 seq;
struct net *net = dev_net(skb->dev);
+
+ if (type == NDISC_REDIRECT)
+ return;
+
sk = inet6_lookup(net, &tcp_hashinfo, &hdr->daddr,
th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
@@ -382,14 +386,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
np = inet6_sk(sk);
- if (type == NDISC_REDIRECT) {
- struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
-
- if (dst)
- dst->ops->redirect(dst, sk, skb);
- goto out;
- }
-
if (type == ICMPV6_PKT_TOOBIG) {
/* We are not interested in TCP_LISTEN and open_requests
* (SYN-ACKs send out by Linux are always <576bytes so
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 5f20686..0d2d4b7 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -413,18 +413,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD);
}
-void sctp_icmp_redirect(struct sock *sk, struct sctp_transport *t,
- struct sk_buff *skb)
-{
- struct dst_entry *dst;
-
- if (!t)
- return;
- dst = sctp_transport_dst_check(t);
- if (dst)
- dst->ops->redirect(dst, sk, skb);
-}
-
/*
* SCTP Implementer's Guide, 2.37 ICMP handling procedures
*
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index da613ce..ee12d87 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -151,6 +151,9 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int err;
struct net *net = dev_net(skb->dev);
+ if (type == NDISC_REDIRECT)
+ return;
+
idev = in6_dev_get(skb->dev);
/* Fix up skb to look at the embedded net header. */
@@ -181,9 +184,6 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
goto out_unlock;
}
break;
- case NDISC_REDIRECT:
- sctp_icmp_redirect(sk, transport, skb);
- break;
default:
break;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-09-13 2:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 2:57 [PATCH v2 0/6] ipv6: Do route updating for redirect in ndisc layer Duan Jiong
2013-09-13 2:58 ` Duan Jiong [this message]
2013-09-13 20:37 ` [PATCH v2 1/6] ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err Hannes Frederic Sowa
2013-09-14 8:20 ` Daniel Borkmann
2013-09-13 2:59 ` [PATCH v2 2/6] ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle Duan Jiong
2013-09-13 3:00 ` [PATCH v2 3/6] ipv6: del statements for dealing with NDISC_REDIRECT Duan Jiong
2013-09-13 3:01 ` [PATCH v2 4/6] ip6tnl: move route updating for redirect to ndisc layer Duan Jiong
2013-09-13 3:02 ` [PATCH v2 5/6] ipv6: modify the err to 0 when dealing with NDISC_REDIRECT Duan Jiong
2013-09-13 3:03 ` [PATCH v2 6/6] ipv6: Do route updating for redirect in ndisc layer Duan Jiong
2013-09-18 0:29 ` David Miller
2013-09-18 1:39 ` Hannes Frederic Sowa
2013-09-18 1:52 ` Duan Jiong
2013-09-18 4:13 ` Hannes Frederic Sowa
2013-09-18 11:57 ` Duan Jiong
2013-10-09 1:43 ` Hannes Frederic Sowa
2013-10-09 7:00 ` Duan Jiong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52327F6F.8050508@cn.fujitsu.com \
--to=duanj.fnst@cn$(echo .)fujitsu.com \
--cc=davem@davemloft$(echo .)net \
--cc=hannes@stressinduktion$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox