summaryrefslogtreecommitdiffstats
path: root/src/shared/local-addresses.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-01-19 11:24:45 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-01-20 08:07:19 +0100
commit37359b1c8181efa98a2bd8a07f3d55c0db42a3c3 (patch)
tree24887407b82dd31ae1631802e0e9d9f999d4458a /src/shared/local-addresses.c
parenttest-local-addresses: several modernization (diff)
downloadsystemd-37359b1c8181efa98a2bd8a07f3d55c0db42a3c3.tar.xz
systemd-37359b1c8181efa98a2bd8a07f3d55c0db42a3c3.zip
local-addresses: rename metric -> priority
To make it consistent with the netlink attribute RTA_PRIORITY.
Diffstat (limited to 'src/shared/local-addresses.c')
-rw-r--r--src/shared/local-addresses.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/local-addresses.c b/src/shared/local-addresses.c
index a1577de0df..216f5388c7 100644
--- a/src/shared/local-addresses.c
+++ b/src/shared/local-addresses.c
@@ -25,7 +25,7 @@ static int address_compare(const struct local_address *a, const struct local_add
if (r != 0)
return r;
- r = CMP(a->metric, b->metric);
+ r = CMP(a->priority, b->priority);
if (r != 0)
return r;
@@ -180,7 +180,7 @@ static int add_local_gateway(
size_t *n_list,
int af,
int ifindex,
- uint32_t metric,
+ uint32_t priority,
const RouteVia *via) {
assert(list);
@@ -195,7 +195,7 @@ static int add_local_gateway(
(*list)[(*n_list)++] = (struct local_address) {
.ifindex = ifindex,
- .metric = metric,
+ .priority = priority,
.family = via->family,
.address = via->address,
};
@@ -249,7 +249,7 @@ int local_gateways(
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;
@@ -283,7 +283,7 @@ int local_gateways(
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;
@@ -308,7 +308,7 @@ int local_gateways(
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;
@@ -322,7 +322,7 @@ int local_gateways(
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;
@@ -344,7 +344,7 @@ int local_gateways(
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;
}