X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Fxfrm4_output.c;h=88fd283e20be16e10e71023bf93c31e992321189;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=191cec718e95ac55cff60acfc16ca2b055e62f15;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c index 191cec718..88fd283e2 100644 --- a/net/ipv4/xfrm4_output.c +++ b/net/ipv4/xfrm4_output.c @@ -58,8 +58,7 @@ static void xfrm4_encap(struct sk_buff *skb) if (!top_iph->frag_off) __ip_select_ident(top_iph, dst, 0); - /* TTL disclosed */ - top_iph->ttl = iph->ttl; + top_iph->ttl = dst_path_metric(dst, RTAX_HOPLIMIT); top_iph->saddr = x->props.saddr.a4; top_iph->daddr = x->id.daddr.a4; @@ -92,35 +91,32 @@ out: return ret; } -int xfrm4_output(struct sk_buff **pskb) +int xfrm4_output(struct sk_buff *skb) { - struct sk_buff *skb = *pskb; struct dst_entry *dst = skb->dst; struct xfrm_state *x = dst->xfrm; int err; if (skb->ip_summed == CHECKSUM_HW) { - err = skb_checksum_help(pskb, 0); - skb = *pskb; + err = skb_checksum_help(skb, 0); if (err) goto error_nolock; } - spin_lock_bh(&x->lock); - err = xfrm_state_check(x, skb); - if (err) - goto error; - if (x->props.mode) { err = xfrm4_tunnel_check_size(skb); if (err) - goto error; + goto error_nolock; } + spin_lock_bh(&x->lock); + err = xfrm_state_check(x, skb); + if (err) + goto error; + xfrm4_encap(skb); - err = x->type->output(pskb); - skb = *pskb; + err = x->type->output(skb); if (err) goto error;