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>
This commit is contained in:
Tom Herbert
2015-08-17 13:42:24 -07:00
committed by David S. Miller
parent f376d4adfd
commit 2536862311
4 changed files with 98 additions and 3 deletions

View File

@@ -1785,8 +1785,14 @@ int ip6_route_add(struct fib6_config *cfg)
if (err)
goto out;
rt->rt6i_lwtstate = lwtstate_get(lwtstate);
if (lwtunnel_output_redirect(rt->rt6i_lwtstate))
if (lwtunnel_output_redirect(rt->rt6i_lwtstate)) {
rt->rt6i_lwtstate->orig_output = rt->dst.output;
rt->dst.output = lwtunnel_output6;
}
if (lwtunnel_input_redirect(rt->rt6i_lwtstate)) {
rt->rt6i_lwtstate->orig_input = rt->dst.input;
rt->dst.input = lwtunnel_input6;
}
}
ipv6_addr_prefix(&rt->rt6i_dst.addr, &cfg->fc_dst, cfg->fc_dst_len);