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:
parent
f8c7d0629f
commit
56dbd2ceec
@ -489,7 +489,7 @@ class TunBuilderCapture : public TunBuilderBase, public RC<thread_unsafe_refcoun
|
|||||||
Route r;
|
Route r;
|
||||||
r.address = address;
|
r.address = address;
|
||||||
r.prefix_length = static_cast<unsigned char>(prefix_length);
|
r.prefix_length = static_cast<unsigned char>(prefix_length);
|
||||||
r.metric = metric;
|
r.metric = (metric < 0 ? route_metric_default : metric);
|
||||||
r.ipv6 = ipv6;
|
r.ipv6 = ipv6;
|
||||||
add_routes.push_back(r);
|
add_routes.push_back(r);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user