0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00

TunBuilderCapture: use default route metric if none was specified

When the user specifies no metric (i.e. value is -1), the TunBuilder
should pass the default value down the stack.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
This commit is contained in:
Antonio Quartulli 2024-03-11 11:06:21 +01:00 committed by Jenkins-dev
parent f8c7d0629f
commit 56dbd2ceec

View File

@ -489,7 +489,7 @@ class TunBuilderCapture : public TunBuilderBase, public RC<thread_unsafe_refcoun
Route r;
r.address = address;
r.prefix_length = static_cast<unsigned char>(prefix_length);
r.metric = metric;
r.metric = (metric < 0 ? route_metric_default : metric);
r.ipv6 = ipv6;
add_routes.push_back(r);
return true;