Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/openvpn/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,10 +1640,10 @@ add_route(struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags,

argv_printf(&argv, "%s add", ROUTE_PATH);

#if 0
#if __FreeBSD_version >= 1600019
if (r->flags & RT_METRIC_DEFINED)
{
argv_printf_cat(&argv, "-rtt %d", r->metric);
argv_printf_cat(&argv, "-metric %d", r->metric);
}
#endif

Expand Down Expand Up @@ -1946,6 +1946,13 @@ add_route_ipv6(struct route_ipv6 *r6, const struct tuntap *tt, unsigned int flag
argv_printf_cat(&argv, "-iface %s", device);
}

#if defined(TARGET_FREEBSD) && __FreeBSD_version >= 1600019
if (r6->flags & RT_METRIC_DEFINED)
{
argv_printf_cat(&argv, "-metric %d", r6->metric);
}
#endif

argv_msg(D_ROUTE, &argv);
bool ret = openvpn_execve_check(&argv, es, 0, "ERROR: *BSD route add -inet6 command failed");
status = ret ? RTA_SUCCESS : RTA_ERROR;
Expand Down