Skip to content

Commit abb9a68

Browse files
NicolasDichtelkuba-moo
authored andcommitted
ipv6: take care of scope when choosing the src addr
When the source address is selected, the scope must be checked. For example, if a loopback address is assigned to the vrf device, it must not be chosen for packets sent outside. CC: stable@vger.kernel.org Fixes: afbac60 ("net: ipv6: Address selection needs to consider L3 domains") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20240710081521.3809742-4-nicolas.dichtel@6wind.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 252442f commit abb9a68

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/ipv6/addrconf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,8 @@ int ipv6_dev_get_saddr(struct net *net, const struct net_device *dst_dev,
18731873
master, &dst,
18741874
scores, hiscore_idx);
18751875

1876-
if (scores[hiscore_idx].ifa)
1876+
if (scores[hiscore_idx].ifa &&
1877+
scores[hiscore_idx].scopedist >= 0)
18771878
goto out;
18781879
}
18791880

0 commit comments

Comments
 (0)