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

[IPSEC]: Fix xfrm[46]_update_pmtu to update top dst

Let's also fix IPsec PMTU storage.  When we get an MTU update for an
xfrm_dst, it should be done to the top dst, not the bottom dst.

For example, when we get a need-to-frag message for host C behind
a our IPsec peer B, we should be updating the dst entry for C and
not B as we do now.

I've removed the boundary checks since the same checks are done
in ipv[46]/route.c already.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d37d463
......@@ -235,10 +235,8 @@ static inline int xfrm4_garbage_collect(void)
static void xfrm4_update_pmtu(struct dst_entry *dst, u32 mtu)
{
struct dst_entry *path = dst->path;
if (mtu < 68 + dst->header_len)
return;
struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
struct dst_entry *path = xdst->route;
path->ops->update_pmtu(path, mtu);
}
......
......@@ -243,12 +243,10 @@ static inline int xfrm6_garbage_collect(void)
static void xfrm6_update_pmtu(struct dst_entry *dst, u32 mtu)
{
struct dst_entry *path = dst->path;
struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
struct dst_entry *path = xdst->route;
if (mtu >= IPV6_MIN_MTU && mtu < dst_pmtu(dst))
path->ops->update_pmtu(path, mtu);
return;
}
static struct dst_ops xfrm6_dst_ops = {
......
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