Skip to content

Commit

Permalink
TunBuilderCapture: use default route metric if none was specified
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ordex authored and Jenkins-dev committed Mar 15, 2024
1 parent f8c7d06 commit 56dbd2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openvpn/tun/builder/capture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 56dbd2c

Please sign in to comment.