if (!top_iph->frag_off)
__ip_select_ident(top_iph, dst, 0);
- top_iph->ttl = dst_path_metric(dst, RTAX_HOPLIMIT);
+ top_iph->ttl = dst_metric(dst->child, RTAX_HOPLIMIT);
top_iph->saddr = x->props.saddr.a4;
top_iph->daddr = x->id.daddr.a4;
IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
- if (!(iph->frag_off & htons(IP_DF)))
+ if (!(iph->frag_off & htons(IP_DF)) || skb->local_df)
goto out;
dst = skb->dst;
- mtu = dst_pmtu(dst) - dst->header_len - dst->trailer_len;
+ mtu = dst_mtu(dst);
if (skb->len > mtu) {
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
ret = -EMSGSIZE;
xfrm4_encap(skb);
- err = x->type->output(skb);
+ err = x->type->output(x, skb);
if (err)
goto error;