aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/icmp.c5
-rw-r--r--net/ipv6/tcp_ipv6.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 0a37ddc7af51..0013cacf7164 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -445,6 +445,8 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
445 445
446 if (__ipv6_addr_needs_scope_id(addr_type)) 446 if (__ipv6_addr_needs_scope_id(addr_type))
447 iif = skb->dev->ifindex; 447 iif = skb->dev->ifindex;
448 else
449 iif = l3mdev_master_ifindex(skb->dev);
448 450
449 /* 451 /*
450 * Must not send error if the source does not uniquely 452 * Must not send error if the source does not uniquely
@@ -499,9 +501,6 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
499 else if (!fl6.flowi6_oif) 501 else if (!fl6.flowi6_oif)
500 fl6.flowi6_oif = np->ucast_oif; 502 fl6.flowi6_oif = np->ucast_oif;
501 503
502 if (!fl6.flowi6_oif)
503 fl6.flowi6_oif = l3mdev_master_ifindex(skb->dev);
504
505 dst = icmpv6_route_lookup(net, skb, sk, &fl6); 504 dst = icmpv6_route_lookup(net, skb, sk, &fl6);
506 if (IS_ERR(dst)) 505 if (IS_ERR(dst))
507 goto out; 506 goto out;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 711d209f9124..f443c6b0ce16 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -810,8 +810,13 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
810 fl6.flowi6_proto = IPPROTO_TCP; 810 fl6.flowi6_proto = IPPROTO_TCP;
811 if (rt6_need_strict(&fl6.daddr) && !oif) 811 if (rt6_need_strict(&fl6.daddr) && !oif)
812 fl6.flowi6_oif = tcp_v6_iif(skb); 812 fl6.flowi6_oif = tcp_v6_iif(skb);
813 else 813 else {
814 if (!oif && netif_index_is_l3_master(net, skb->skb_iif))
815 oif = skb->skb_iif;
816
814 fl6.flowi6_oif = oif; 817 fl6.flowi6_oif = oif;
818 }
819
815 fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark); 820 fl6.flowi6_mark = IP6_REPLY_MARK(net, skb->mark);
816 fl6.fl6_dport = t1->dest; 821 fl6.fl6_dport = t1->dest;
817 fl6.fl6_sport = t1->source; 822 fl6.fl6_sport = t1->source;