if (r != 0)
return r;
- r = CMP(a->metric, b->metric);
+ r = CMP(a->priority, b->priority);
if (r != 0)
return r;
size_t *n_list,
int af,
int ifindex,
- uint32_t metric,
+ uint32_t priority,
const RouteVia *via) {
assert(list);
(*list)[(*n_list)++] = (struct local_address) {
.ifindex = ifindex,
- .metric = metric,
+ .priority = priority,
.family = via->family,
.address = via->address,
};
union in_addr_union gateway;
uint16_t type;
unsigned char dst_len, src_len, table;
- uint32_t ifi = 0, metric = 0;
+ uint32_t ifi = 0, priority = 0;
size_t rta_len;
int family;
RouteVia via;
if (table != RT_TABLE_MAIN)
continue;
- r = sd_netlink_message_read_u32(m, RTA_PRIORITY, &metric);
+ r = sd_netlink_message_read_u32(m, RTA_PRIORITY, &priority);
if (r < 0 && r != -ENODATA)
return r;
if (r >= 0) {
via.family = family;
via.address = gateway;
- r = add_local_gateway(&list, &n_list, af, ifi, metric, &via);
+ r = add_local_gateway(&list, &n_list, af, ifi, priority, &via);
if (r < 0)
return r;
if (r < 0 && r != -ENODATA)
return r;
if (r >= 0) {
- r = add_local_gateway(&list, &n_list, af, ifi, metric, &via);
+ r = add_local_gateway(&list, &n_list, af, ifi, priority, &via);
if (r < 0)
return r;
if (ifindex > 0 && mr->ifindex != ifindex)
continue;
- r = add_local_gateway(&list, &n_list, af, ifi, metric, &mr->gateway);
+ r = add_local_gateway(&list, &n_list, af, ifi, priority, &mr->gateway);
if (r < 0)
return r;
}
static void print_local_addresses(const struct local_address *a, size_t n) {
FOREACH_ARRAY(i, a, n)
- log_debug("%s ifindex=%i scope=%u metric=%"PRIu32" address=%s",
- af_to_name(i->family), i->ifindex, i->scope, i->metric,
+ log_debug("%s ifindex=%i scope=%u priority=%"PRIu32" address=%s",
+ af_to_name(i->family), i->ifindex, i->scope, i->priority,
IN_ADDR_TO_STRING(i->family, &i->address));
}