Skip to content

Commit 56dbd2c

Browse files
ordexJenkins-dev
authored andcommitted
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 <[email protected]>
1 parent f8c7d06 commit 56dbd2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openvpn/tun/builder/capture.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ class TunBuilderCapture : public TunBuilderBase, public RC<thread_unsafe_refcoun
489489
Route r;
490490
r.address = address;
491491
r.prefix_length = static_cast<unsigned char>(prefix_length);
492-
r.metric = metric;
492+
r.metric = (metric < 0 ? route_metric_default : metric);
493493
r.ipv6 = ipv6;
494494
add_routes.push_back(r);
495495
return true;

0 commit comments

Comments
 (0)