summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-06-17 15:57:41 +0200
committerThomas Haller <thaller@redhat.com>2021-06-23 13:11:56 +0200
commit524114add7004bc07c06b5518c5afb6eacbf0217 (patch)
tree422076e18ce024f3e816303e7e664a5d8aabf5c6
parent3aad301003f2a623119d5a126ca1b150e24e8ac5 (diff)
dhcp: minor cleanup of DHCP plugin factory
-rw-r--r--src/core/dhcp/nm-dhcp-listener.c3
-rw-r--r--src/core/dhcp/nm-dhcp-manager.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/core/dhcp/nm-dhcp-listener.c b/src/core/dhcp/nm-dhcp-listener.c
index b8bb3c33a0..ae2c40f10f 100644
--- a/src/core/dhcp/nm-dhcp-listener.c
+++ b/src/core/dhcp/nm-dhcp-listener.c
@@ -26,8 +26,9 @@
/*****************************************************************************/
const NMDhcpClientFactory *const _nm_dhcp_manager_factories[6] = {
+
/* the order here matters, as we will try the plugins in this order to find
- * the first available plugin. */
+ * the first available plugin. */
#if WITH_DHCPCANON
&_nm_dhcp_client_factory_dhcpcanon,
diff --git a/src/core/dhcp/nm-dhcp-manager.c b/src/core/dhcp/nm-dhcp-manager.c
index 44b8ede2c0..d6393eb127 100644
--- a/src/core/dhcp/nm-dhcp-manager.c
+++ b/src/core/dhcp/nm-dhcp-manager.c
@@ -63,9 +63,9 @@ _client_factory_find_by_name(const char *name)
{
int i;
- g_return_val_if_fail(name, NULL);
+ nm_assert(name);
- for (i = 0; i < G_N_ELEMENTS(_nm_dhcp_manager_factories); i++) {
+ for (i = 0; i < (int) G_N_ELEMENTS(_nm_dhcp_manager_factories); i++) {
const NMDhcpClientFactory *f = _nm_dhcp_manager_factories[i];
if (f && nm_streq(f->name, name))
@@ -598,7 +598,7 @@ nm_dhcp_manager_init(NMDhcpManager *self)
c_list_init(&priv->dhcp_client_lst_head);
- for (i = 0; i < G_N_ELEMENTS(_nm_dhcp_manager_factories); i++) {
+ for (i = 0; i < (int) G_N_ELEMENTS(_nm_dhcp_manager_factories); i++) {
const NMDhcpClientFactory *f = _nm_dhcp_manager_factories[i];
if (!f)
@@ -644,7 +644,7 @@ nm_dhcp_manager_init(NMDhcpManager *self)
}
}
if (!client_factory) {
- for (i = 0; i < G_N_ELEMENTS(_nm_dhcp_manager_factories); i++) {
+ for (i = 0; i < (int) G_N_ELEMENTS(_nm_dhcp_manager_factories); i++) {
client_factory = _client_factory_available(_nm_dhcp_manager_factories[i]);
if (client_factory)
break;