From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, hannes@stressinduktion.org
Subject: [PATCH 01/11] ipv6: Do route updating for redirect in ndisc layer
Date: Thu, 12 Sep 2013 18:43:56 +0800 [thread overview]
Message-ID: <52319AEC.1010206@cn.fujitsu.com> (raw)
In-Reply-To: <52319A6E.6090503@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Do the whole verification and route updating in ndisc
lay and then just call into icmpv6_notify() to notify
the upper protocols if we have the data of the
redirected header option.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
include/net/ip6_route.h | 3 ---
net/ipv6/ndisc.c | 6 ++----
net/ipv6/route.c | 29 ++---------------------------
3 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f525e70..5db259e 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -133,9 +133,6 @@ extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk,
__be32 mtu);
extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark);
-extern void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
- u32 mark);
-extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk);
struct netlink_callback;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f8a55ff..6bd1b41 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1368,11 +1368,9 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts))
return;
- if (!ndopts.nd_opts_rh) {
- ip6_redirect_no_header(skb, dev_net(skb->dev),
- skb->dev->ifindex, 0);
+ ip6_redirect(skb, dev_net(skb->dev), skb->dev->ifindex, 0);
+ if (!ndopts.nd_opts_rh)
return;
- }
hdr = (u8 *)ndopts.nd_opts_rh;
hdr += 8;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c979dd9..151bd6c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1227,27 +1227,7 @@ static struct dst_entry *ip6_route_redirect(struct net *net,
flags, __ip6_route_redirect);
}
-void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
-{
- const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
- struct dst_entry *dst;
- struct flowi6 fl6;
-
- memset(&fl6, 0, sizeof(fl6));
- fl6.flowi6_oif = oif;
- fl6.flowi6_mark = mark;
- fl6.flowi6_flags = 0;
- fl6.daddr = iph->daddr;
- fl6.saddr = iph->saddr;
- fl6.flowlabel = ip6_flowinfo(iph);
-
- dst = ip6_route_redirect(net, &fl6, &ipv6_hdr(skb)->saddr);
- rt6_do_redirect(dst, NULL, skb);
- dst_release(dst);
-}
-EXPORT_SYMBOL_GPL(ip6_redirect);
-
-void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
+void ip6_redirect(struct sk_buff *skb, struct net *net, int oif,
u32 mark)
{
const struct ipv6hdr *iph = ipv6_hdr(skb);
@@ -1266,12 +1246,7 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
rt6_do_redirect(dst, NULL, skb);
dst_release(dst);
}
-
-void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk)
-{
- ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);
-}
-EXPORT_SYMBOL_GPL(ip6_sk_redirect);
+EXPORT_SYMBOL_GPL(ip6_redirect);
static unsigned int ip6_default_advmss(const struct dst_entry *dst)
{
--
1.8.3.1
next prev parent reply other threads:[~2013-09-12 10:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 10:41 [PATCH 00/11] ipv6: Do route updating for redirect in ndisc layer Duan Jiong
2013-09-12 10:43 ` Duan Jiong [this message]
2013-09-12 21:54 ` [PATCH 01/11] " Hannes Frederic Sowa
2013-09-12 10:44 ` [PATCH 02/11] dccp: move route updating for redirect to " Duan Jiong
2013-09-12 10:45 ` [PATCH 03/11] ipv6: " Duan Jiong
2013-09-12 10:46 ` [PATCH 04/11] " Duan Jiong
2013-09-12 19:03 ` David Miller
2013-09-12 10:47 ` [PATCH 05/11] " Duan Jiong
2013-09-12 10:49 ` [PATCH 06/11] ip6tnl: " Duan Jiong
2013-09-12 10:49 ` [PATCH 07/11] ipv6: " Duan Jiong
2013-09-12 10:50 ` [PATCH 08/11] " Duan Jiong
2013-09-12 10:51 ` [PATCH 09/11] sctp: " Duan Jiong
2013-09-12 12:33 ` Daniel Borkmann
2013-09-12 12:33 ` Daniel Borkmann
2013-09-12 10:51 ` [PATCH 10/11] ipv6: " Duan Jiong
2013-09-12 22:04 ` Hannes Frederic Sowa
2013-09-13 1:38 ` Duan Jiong
2013-09-12 10:52 ` [PATCH 11/11] " 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=52319AEC.1010206@cn.fujitsu.com \
--to=duanj.fnst@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.