]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix IPv4 default gateway with multiple route tables
authorVladislav Grishenko <themiron@yandex-team.ru>
Fri, 16 Apr 2021 12:07:07 +0000 (17:07 +0500)
committerGert Doering <gert@greenie.muc.de>
Sun, 18 Apr 2021 14:13:24 +0000 (16:13 +0200)
commit48ba0b059138dec7a94d2368375344d39c4e05e9
tree0715c1830acf622ebab01cacc5dcad0f678cabee
parent7b594d4980f696583397a3b87e5c928acba17081
Fix IPv4 default gateway with multiple route tables

Current default gateway selection for zero destination address just
dumps and parses all the routing tables. If any of non-main table
with default route comes first, wrong default gateway can be picked.
Since adding/removing routes currently handles only main table,
let's stick to RT_TABLE_MAIN while selecting default route too.

v2: keep gateway address unchanged on lookup error
v3: reduce ammout of gateway address copying

Reported-by: Donald Sharp <donaldsharp72@gmail.com>
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20210416120708.1532-1-themiron@yandex-team.ru>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22130.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit c7f95891a4a0aabb64e7d4f3200525c1a2fcf433)
src/openvpn/networking_sitnl.c