diff --git a/l2tpns.c b/l2tpns.c index 3f16c73..4c47734 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -1545,6 +1545,7 @@ static void routeset(sessionidt s, in_addr_t ip, int prefixlen, in_addr_t gw, in struct rtmsg rt; char buf[32]; } req; + int metric; int i; in_addr_t n_ip; @@ -1583,6 +1584,8 @@ static void routeset(sessionidt s, in_addr_t ip, int prefixlen, in_addr_t gw, in n_ip = htonl(gw); rtnetlink_addattr(&req.nh, RTA_GATEWAY, &n_ip, sizeof(n_ip)); } + metric = 1; + rtnetlink_addattr(&req.nh, RTA_PRIORITY, &metric, sizeof(metric)); LOG(1, s, session[s].tunnel, "Route %s %s/%d%s%s\n", add ? "add" : "del", fmtaddr(htonl(ip), 0), prefixlen, @@ -1703,7 +1706,7 @@ void route6set(sessionidt s, struct in6_addr ip, int prefixlen, int add) rtnetlink_addattr(&req.nh, RTA_OIF, &idx, sizeof(idx)); rtnetlink_addattr(&req.nh, RTA_DST, &ip, sizeof(ip)); metric = 1; - rtnetlink_addattr(&req.nh, RTA_METRICS, &metric, sizeof(metric)); + rtnetlink_addattr(&req.nh, RTA_PRIORITY, &metric, sizeof(metric)); LOG(1, s, session[s].tunnel, "Route %s %s/%d\n", add ? "add" : "del",