diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-12 03:49:19 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-12 03:49:19 -0700 |
commit | 3ec5a261aef55a32664bffd335e5c32aeadf3215 (patch) | |
tree | a2ddd1e4c432d7300396814320608ee946030fc1 /net/ipv4/xfrm4_policy.c | |
parent | tcp: TCP Small Queues (diff) | |
parent | net: Remove checks for dst_ops->redirect being NULL. (diff) | |
download | linux-dev-3ec5a261aef55a32664bffd335e5c32aeadf3215.tar.xz linux-dev-3ec5a261aef55a32664bffd335e5c32aeadf3215.zip |
Merge branch 'redirect_via_sock'
As described in my patch series from the other day, we need to
rearrange redirect handling so that the local initiators of packets
(sockets, tunnels, xfrms, etc.) that implement the protocols compute
the route and pass this down into the ipv4/ipv6 routing code.
These changes here do so by implementing a new dst_ops->redirect
method.
No more do we have this funny code that tries several different sets
of routing keys to try and figure out which route the redirect should
actually be applied to.
No more do we have the problem wherein TOS rewriting causes problems
for us.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/xfrm4_policy.c')
-rw-r--r-- | net/ipv4/xfrm4_policy.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 87d3fcc302d4..737131cef375 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -202,6 +202,14 @@ static void xfrm4_update_pmtu(struct dst_entry *dst, u32 mtu) path->ops->update_pmtu(path, mtu); } +static void xfrm4_redirect(struct dst_entry *dst, struct sk_buff *skb) +{ + struct xfrm_dst *xdst = (struct xfrm_dst *)dst; + struct dst_entry *path = xdst->route; + + path->ops->redirect(path, skb); +} + static void xfrm4_dst_destroy(struct dst_entry *dst) { struct xfrm_dst *xdst = (struct xfrm_dst *)dst; @@ -225,6 +233,7 @@ static struct dst_ops xfrm4_dst_ops = { .protocol = cpu_to_be16(ETH_P_IP), .gc = xfrm4_garbage_collect, .update_pmtu = xfrm4_update_pmtu, + .redirect = xfrm4_redirect, .cow_metrics = dst_cow_metrics_generic, .destroy = xfrm4_dst_destroy, .ifdown = xfrm4_dst_ifdown, |