Commit 45ff5a3f authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ce68ceb
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/inetdevice.h> #include <linux/inetdevice.h>
#include <net/dst.h>
#include <net/xfrm.h> #include <net/xfrm.h>
#include <net/ip.h> #include <net/ip.h>
...@@ -167,7 +168,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int ...@@ -167,7 +168,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
dst_prev->trailer_len = trailer_len; dst_prev->trailer_len = trailer_len;
memcpy(&dst_prev->metrics, &x->route->metrics, sizeof(dst_prev->metrics)); 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; dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output;
if (rt0->peer) if (rt0->peer)
atomic_inc(&rt0->peer->refcnt); atomic_inc(&rt0->peer->refcnt);
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <net/addrconf.h> #include <net/addrconf.h>
#include <net/dst.h>
#include <net/xfrm.h> #include <net/xfrm.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/ipv6.h> #include <net/ipv6.h>
...@@ -214,7 +215,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int ...@@ -214,7 +215,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
dst_prev->trailer_len = trailer_len; dst_prev->trailer_len = trailer_len;
memcpy(&dst_prev->metrics, &x->route->metrics, sizeof(dst_prev->metrics)); 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; dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output;
/* Sheit... I remember I did this right. Apparently, /* Sheit... I remember I did this right. Apparently,
* it was magically lost, so this code needs audit */ * it was magically lost, so this code needs audit */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment