Skip to content

Commit 326bf17

Browse files
Alex Gartrellhorms
authored andcommitted
ipvs: fix ipv6 route unreach panic
Previously there was a trivial panic unshare -n /bin/bash <<EOF ip addr add dev lo face::1/128 ipvsadm -A -t [face::1]:15213 ipvsadm -a -t [face::1]:15213 -r b00c::1 echo boom | nc face::1 15213 EOF This patch allows us to replicate the net logic above and simply capture the skb_dst(skb)->dev and use that for the purpose of the invocation. Signed-off-by: Alex Gartrell <agartrell@fb.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
1 parent 484836e commit 326bf17

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/netfilter/ipvs/ip_vs_xmit.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,13 @@ __ip_vs_get_out_rt_v6(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest,
505505
return -1;
506506

507507
err_unreach:
508+
/* The ip6_link_failure function requires the dev field to be set
509+
* in order to get the net (further for the sake of fwmark
510+
* reflection).
511+
*/
512+
if (!skb->dev)
513+
skb->dev = skb_dst(skb)->dev;
514+
508515
dst_link_failure(skb);
509516
return -1;
510517
}

0 commit comments

Comments
 (0)