From: Herbert Xu Date: Wed, 14 Nov 2007 05:35:32 +0000 (-0800) Subject: [IPSEC]: Set dst->input to dst_discard X-Git-Tag: v2.6.25-rc1~1162^2~1455 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45ff5a3f9a3d0b1b4f063b5285ab39b7fac59471;p=linux-2.6 [IPSEC]: Set dst->input to dst_discard The input function should never be invoked on IPsec dst objects. This is because we don't apply IPsec on input until after we've made the routing decision. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 7d250a1bd2..c40a71b74d 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -167,7 +168,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int dst_prev->trailer_len = trailer_len; memcpy(&dst_prev->metrics, &x->route->metrics, sizeof(dst_prev->metrics)); - dst_prev->input = rt->u.dst.input; + dst_prev->input = dst_discard; dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output; if (rt0->peer) atomic_inc(&rt0->peer->refcnt); diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index bc508d0a87..89432279d3 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -214,7 +215,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int dst_prev->trailer_len = trailer_len; memcpy(&dst_prev->metrics, &x->route->metrics, sizeof(dst_prev->metrics)); - dst_prev->input = rt->u.dst.input; + dst_prev->input = dst_discard; dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output; /* Sheit... I remember I did this right. Apparently, * it was magically lost, so this code needs audit */