xfrm: add route lookup to xfrm4_rcv_encap
At this point, with TCP encapsulation, the dst may be gone, but xfrm_input needs one. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:

committed by
Steffen Klassert

parent
7b3801927e
commit
cac3c71604
@@ -72,6 +72,14 @@ int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
|
|||||||
if (!head)
|
if (!head)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if (!skb_dst(skb)) {
|
||||||
|
const struct iphdr *iph = ip_hdr(skb);
|
||||||
|
|
||||||
|
if (ip_route_input_noref(skb, iph->daddr, iph->saddr,
|
||||||
|
iph->tos, skb->dev))
|
||||||
|
goto drop;
|
||||||
|
}
|
||||||
|
|
||||||
for_each_protocol_rcu(*head, handler)
|
for_each_protocol_rcu(*head, handler)
|
||||||
if ((ret = handler->input_handler(skb, nexthdr, spi, encap_type)) != -EINVAL)
|
if ((ret = handler->input_handler(skb, nexthdr, spi, encap_type)) != -EINVAL)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -79,6 +87,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
|
|||||||
out:
|
out:
|
||||||
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
|
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
|
||||||
|
|
||||||
|
drop:
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user