summary refs log tree commit diff
path: root/src/libnm-base
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnm-base')
-rw-r--r--src/libnm-base/nm-base.h14
-rw-r--r--src/libnm-base/nm-ethtool-base.c12
-rw-r--r--src/libnm-base/nm-ethtool-utils-base.h2
3 files changed, 21 insertions, 7 deletions
diff --git a/src/libnm-base/nm-base.h b/src/libnm-base/nm-base.h
index ff062a18..74e8142f 100644
--- a/src/libnm-base/nm-base.h
+++ b/src/libnm-base/nm-base.h
@@ -393,6 +393,12 @@ typedef struct {
 
 #define NM_BOND_PORT_QUEUE_ID_DEF 0
 
+/****************************************************************************/
+
+/* ifindex generation is per-net namespace, and loopback is always the first
+ * device in the network namespace, thus any loopback device should get ifindex 1. */
+#define NM_LOOPBACK_IFINDEX 1
+
 /*****************************************************************************/
 
 /* NM_CRYPTO_ERROR is part of public API in libnm (implemented in libnm-core).
@@ -409,4 +415,12 @@ typedef struct {
 #define _NM_CRYPTO_ERROR _nm_crypto_error_quark()
 GQuark _nm_crypto_error_quark(void);
 
+typedef enum {
+    NM_DNS_IP_CONFIG_TYPE_REMOVED = -1,
+
+    NM_DNS_IP_CONFIG_TYPE_DEFAULT = 0,
+    NM_DNS_IP_CONFIG_TYPE_BEST_DEVICE,
+    NM_DNS_IP_CONFIG_TYPE_VPN,
+} NMDnsIPConfigType;
+
 #endif /* __NM_LIBNM_BASE_H__ */
diff --git a/src/libnm-base/nm-ethtool-base.c b/src/libnm-base/nm-ethtool-base.c
index a75df8a0..c31cff6f 100644
--- a/src/libnm-base/nm-ethtool-base.c
+++ b/src/libnm-base/nm-ethtool-base.c
@@ -271,12 +271,12 @@ nm_ethtool_data_get_by_optname(const char *optname)
 
     _ASSERT_data();
 
-    idx = nm_utils_array_find_binary_search(_by_name,
-                                            sizeof(_by_name[0]),
-                                            _NM_ETHTOOL_ID_NUM,
-                                            optname,
-                                            _by_name_cmp,
-                                            NULL);
+    idx = nm_array_find_bsearch(_by_name,
+                                _NM_ETHTOOL_ID_NUM,
+                                sizeof(_by_name[0]),
+                                optname,
+                                _by_name_cmp,
+                                NULL);
     return (idx < 0) ? NULL : nm_ethtool_data[_by_name[idx]];
 }
 
diff --git a/src/libnm-base/nm-ethtool-utils-base.h b/src/libnm-base/nm-ethtool-utils-base.h
index 3656ed3f..fa9c3071 100644
--- a/src/libnm-base/nm-ethtool-utils-base.h
+++ b/src/libnm-base/nm-ethtool-utils-base.h
@@ -3,7 +3,7 @@
  * Copyright (C) 2018 Red Hat, Inc.
  */
 
-#ifndef __NM_ETHTOOL_UTILS_H__ /* lgtm[cpp/duplicate-include-guard] */
+#ifndef __NM_ETHTOOL_UTILS_H__
 #define __NM_ETHTOOL_UTILS_H__
 
 G_BEGIN_DECLS