diff options
author | Mike Manning <mvrmanning@gmail.com> | 2021-10-05 16:03:42 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-07 17:27:55 +0300 |
commit | 8d6c414cd2fb74aa6812e9bfec6178f8246c4f3a (patch) | |
tree | 22c960ed3257f8238013ab938455c6f518982be7 /Documentation | |
parent | 7671b026bb389a5a01722dd3ecf80b44703e9e84 (diff) | |
download | linux-8d6c414cd2fb74aa6812e9bfec6178f8246c4f3a.tar.xz |
net: prefer socket bound to interface when not in VRF
The commit 6da5b0f027a8 ("net: ensure unbound datagram socket to be
chosen when not in a VRF") modified compute_score() so that a device
match is always made, not just in the case of an l3mdev skb, then
increments the score also for unbound sockets. This ensures that
sockets bound to an l3mdev are never selected when not in a VRF.
But as unbound and bound sockets are now scored equally, this results
in the last opened socket being selected if there are matches in the
default VRF for an unbound socket and a socket bound to a dev that is
not an l3mdev. However, handling prior to this commit was to always
select the bound socket in this case. Reinstate this handling by
incrementing the score only for bound sockets. The required isolation
due to choosing between an unbound socket and a socket bound to an
l3mdev remains in place due to the device match always being made.
The same approach is taken for compute_score() for stream sockets.
Fixes: 6da5b0f027a8 ("net: ensure unbound datagram socket to be chosen when not in a VRF")
Fixes: e78190581aff ("net: ensure unbound stream socket to be chosen when not in a VRF")
Signed-off-by: Mike Manning <mmanning@vyatta.att-mail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/cf0a8523-b362-1edf-ee78-eef63cbbb428@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions