summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-08-17 13:42:24 -0700
committerDavid S. Miller <davem@davemloft.net>2015-08-17 21:33:05 -0700
commit2536862311d2276454ddef9dc36d6551a4b400fd (patch)
tree7be7caf4f95bdd2c50749dc2d42319acbc250030 /net/ipv4
parentf376d4adfdd2d860aea3e99aa86e98324621ece7 (diff)
downloadlinux-stable-2536862311d2276454ddef9dc36d6551a4b400fd.tar.gz
linux-stable-2536862311d2276454ddef9dc36d6551a4b400fd.tar.bz2
linux-stable-2536862311d2276454ddef9dc36d6551a4b400fd.zip
lwt: Add support to redirect dst.input
This patch adds the capability to redirect dst input in the same way that dst output is redirected by LWT. Also, save the original dst.input and and dst.out when setting up lwtunnel redirection. These can be called by the client as a pass- through. Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/route.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 2c89d294b669..2403e85107f0 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1631,8 +1631,14 @@ static int __mkroute_input(struct sk_buff *skb,
rth->dst.output = ip_output;
rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag);
- if (lwtunnel_output_redirect(rth->rt_lwtstate))
+ if (lwtunnel_output_redirect(rth->rt_lwtstate)) {
+ rth->rt_lwtstate->orig_output = rth->dst.output;
rth->dst.output = lwtunnel_output;
+ }
+ if (lwtunnel_input_redirect(rth->rt_lwtstate)) {
+ rth->rt_lwtstate->orig_input = rth->dst.input;
+ rth->dst.input = lwtunnel_input;
+ }
skb_dst_set(skb, &rth->dst);
out:
err = 0;