aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-08-03 17:19:42 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-08-04 01:25:20 +0200
commit257a6b0b7e76e17bdd6e107ae643db4466960654 (patch)
tree9733127babbc8cc8a5ef49c6a0332f76b3fd5238 /conf.c
parenteff3bcb24547e671e63df9b70157c3ff9bb9f95a (diff)
downloadpasst-257a6b0b7e76e17bdd6e107ae643db4466960654.tar
passt-257a6b0b7e76e17bdd6e107ae643db4466960654.tar.gz
passt-257a6b0b7e76e17bdd6e107ae643db4466960654.tar.bz2
passt-257a6b0b7e76e17bdd6e107ae643db4466960654.tar.lz
passt-257a6b0b7e76e17bdd6e107ae643db4466960654.tar.xz
passt-257a6b0b7e76e17bdd6e107ae643db4466960654.tar.zst
passt-257a6b0b7e76e17bdd6e107ae643db4466960654.zip
netlink: Split nl_route() into separate operation functions
nl_route() can perform 3 quite different operations based on the 'op' parameter. Split this into separate functions for each one. This requires more lines of code, but makes the internal logic of each operation much easier to follow. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/conf.c b/conf.c
index 2c2eb05..e538b08 100644
--- a/conf.c
+++ b/conf.c
@@ -649,7 +649,7 @@ static unsigned int conf_ip4(unsigned int ifi,
}
if (IN4_IS_ADDR_UNSPECIFIED(&ip4->gw))
- nl_route(NL_GET, ifi, 0, AF_INET, &ip4->gw);
+ nl_route_get_def(ifi, AF_INET, &ip4->gw);
if (IN4_IS_ADDR_UNSPECIFIED(&ip4->addr))
nl_addr_get(ifi, AF_INET, &ip4->addr, &ip4->prefix_len, NULL);
@@ -700,7 +700,7 @@ static unsigned int conf_ip6(unsigned int ifi,
}
if (IN6_IS_ADDR_UNSPECIFIED(&ip6->gw))
- nl_route(NL_GET, ifi, 0, AF_INET6, &ip6->gw);
+ nl_route_get_def(ifi, AF_INET6, &ip6->gw);
nl_addr_get(ifi, AF_INET6,
IN6_IS_ADDR_UNSPECIFIED(&ip6->addr) ? &ip6->addr : NULL,