diff options
-rw-r--r-- | net/ipv6/raw.c | 3 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_xmit.c | 13 | ||||
-rw-r--r-- | net/netfilter/xt_TEE.c | 1 |
3 files changed, 13 insertions, 4 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 8072bd4139b7..484a5c144073 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -865,6 +865,9 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) | |||
865 | fl6.flowi6_oif = np->ucast_oif; | 865 | fl6.flowi6_oif = np->ucast_oif; |
866 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); | 866 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
867 | 867 | ||
868 | if (inet->hdrincl) | ||
869 | fl6.flowi6_flags |= FLOWI_FLAG_KNOWN_NH; | ||
870 | |||
868 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); | 871 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p); |
869 | if (IS_ERR(dst)) { | 872 | if (IS_ERR(dst)) { |
870 | err = PTR_ERR(dst); | 873 | err = PTR_ERR(dst); |
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index 5eff9f6dcfb8..bf66a8657a5f 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c | |||
@@ -364,13 +364,16 @@ err_unreach: | |||
364 | #ifdef CONFIG_IP_VS_IPV6 | 364 | #ifdef CONFIG_IP_VS_IPV6 |
365 | static struct dst_entry * | 365 | static struct dst_entry * |
366 | __ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr, | 366 | __ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr, |
367 | struct in6_addr *ret_saddr, int do_xfrm) | 367 | struct in6_addr *ret_saddr, int do_xfrm, int rt_mode) |
368 | { | 368 | { |
369 | struct dst_entry *dst; | 369 | struct dst_entry *dst; |
370 | struct flowi6 fl6 = { | 370 | struct flowi6 fl6 = { |
371 | .daddr = *daddr, | 371 | .daddr = *daddr, |
372 | }; | 372 | }; |
373 | 373 | ||
374 | if (rt_mode & IP_VS_RT_MODE_KNOWN_NH) | ||
375 | fl6.flowi6_flags = FLOWI_FLAG_KNOWN_NH; | ||
376 | |||
374 | dst = ip6_route_output(net, NULL, &fl6); | 377 | dst = ip6_route_output(net, NULL, &fl6); |
375 | if (dst->error) | 378 | if (dst->error) |
376 | goto out_err; | 379 | goto out_err; |
@@ -427,7 +430,7 @@ __ip_vs_get_out_rt_v6(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest, | |||
427 | } | 430 | } |
428 | dst = __ip_vs_route_output_v6(net, &dest->addr.in6, | 431 | dst = __ip_vs_route_output_v6(net, &dest->addr.in6, |
429 | &dest_dst->dst_saddr.in6, | 432 | &dest_dst->dst_saddr.in6, |
430 | do_xfrm); | 433 | do_xfrm, rt_mode); |
431 | if (!dst) { | 434 | if (!dst) { |
432 | __ip_vs_dst_set(dest, NULL, NULL, 0); | 435 | __ip_vs_dst_set(dest, NULL, NULL, 0); |
433 | spin_unlock_bh(&dest->dst_lock); | 436 | spin_unlock_bh(&dest->dst_lock); |
@@ -446,7 +449,8 @@ __ip_vs_get_out_rt_v6(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest, | |||
446 | *ret_saddr = dest_dst->dst_saddr.in6; | 449 | *ret_saddr = dest_dst->dst_saddr.in6; |
447 | } else { | 450 | } else { |
448 | noref = 0; | 451 | noref = 0; |
449 | dst = __ip_vs_route_output_v6(net, daddr, ret_saddr, do_xfrm); | 452 | dst = __ip_vs_route_output_v6(net, daddr, ret_saddr, do_xfrm, |
453 | rt_mode); | ||
450 | if (!dst) | 454 | if (!dst) |
451 | goto err_unreach; | 455 | goto err_unreach; |
452 | rt = (struct rt6_info *) dst; | 456 | rt = (struct rt6_info *) dst; |
@@ -1164,7 +1168,8 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
1164 | local = __ip_vs_get_out_rt_v6(cp->af, skb, cp->dest, &cp->daddr.in6, | 1168 | local = __ip_vs_get_out_rt_v6(cp->af, skb, cp->dest, &cp->daddr.in6, |
1165 | NULL, ipvsh, 0, | 1169 | NULL, ipvsh, 0, |
1166 | IP_VS_RT_MODE_LOCAL | | 1170 | IP_VS_RT_MODE_LOCAL | |
1167 | IP_VS_RT_MODE_NON_LOCAL); | 1171 | IP_VS_RT_MODE_NON_LOCAL | |
1172 | IP_VS_RT_MODE_KNOWN_NH); | ||
1168 | if (local < 0) | 1173 | if (local < 0) |
1169 | goto tx_error; | 1174 | goto tx_error; |
1170 | if (local) { | 1175 | if (local) { |
diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c index 292934d23482..a747eb475b68 100644 --- a/net/netfilter/xt_TEE.c +++ b/net/netfilter/xt_TEE.c | |||
@@ -152,6 +152,7 @@ tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info) | |||
152 | fl6.daddr = info->gw.in6; | 152 | fl6.daddr = info->gw.in6; |
153 | fl6.flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) | | 153 | fl6.flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) | |
154 | (iph->flow_lbl[1] << 8) | iph->flow_lbl[2]; | 154 | (iph->flow_lbl[1] << 8) | iph->flow_lbl[2]; |
155 | fl6.flowi6_flags = FLOWI_FLAG_KNOWN_NH; | ||
155 | dst = ip6_route_output(net, NULL, &fl6); | 156 | dst = ip6_route_output(net, NULL, &fl6); |
156 | if (dst->error) { | 157 | if (dst->error) { |
157 | dst_release(dst); | 158 | dst_release(dst); |