if (r != 0)
return r;
+ r = CMP(a->weight, b->weight);
+ if (r != 0)
+ return r;
+
r = CMP(a->ifindex, b->ifindex);
if (r != 0)
return r;
int ifindex,
unsigned char scope,
uint32_t priority,
+ uint32_t weight,
int family,
const union in_addr_union *address) {
.ifindex = ifindex,
.scope = scope,
.priority = priority,
+ .weight = weight,
.family = family,
.address = *address,
};
int family,
const union in_addr_union *address) {
- return add_local_address_full(list, n_list, ifindex, scope, 0, family, address);
+ return add_local_address_full(list, n_list, ifindex, scope, 0, 0, family, address);
}
int local_addresses(
size_t *n_list,
int ifindex,
uint32_t priority,
+ uint32_t weight,
int family,
const union in_addr_union *address) {
- return add_local_address_full(list, n_list, ifindex, 0, priority, family, address);
+ return add_local_address_full(list, n_list, ifindex, 0, priority, weight, family, address);
}
int local_gateways(
if (r < 0 && r != -ENODATA)
return r;
if (r >= 0) {
- r = add_local_gateway(&list, &n_list, ifi, priority, family, &gateway);
+ r = add_local_gateway(&list, &n_list, ifi, priority, 0, family, &gateway);
if (r < 0)
return r;
if (via.family != AF_INET6)
return -EBADMSG;
- r = add_local_gateway(&list, &n_list, ifi, priority, via.family,
+ r = add_local_gateway(&list, &n_list, ifi, priority, 0, via.family,
&(union in_addr_union) { .in6 = via.address.in6 });
if (r < 0)
return r;
continue;
union in_addr_union a = mr->gateway.address;
- r = add_local_gateway(&list, &n_list, ifi, priority, mr->gateway.family, &a);
+ r = add_local_gateway(&list, &n_list, ifi, priority, mr->weight, mr->gateway.family, &a);
if (r < 0)
return r;
}
int family,
const union in_addr_union *address) {
- return add_local_address_full(list, n_list, ifindex, 0, 0, family, address);
+ return add_local_address_full(list, n_list, ifindex, 0, 0, 0, family, address);
}
int local_outbounds(
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 priority=%"PRIu32" address=%s",
- af_to_name(i->family), i->ifindex, i->scope, i->priority,
+ log_debug("%s ifindex=%i scope=%u priority=%"PRIu32" weight=%"PRIu32" address=%s",
+ af_to_name(i->family), i->ifindex, i->scope, i->priority, i->weight,
IN_ADDR_TO_STRING(i->family, &i->address));
}