mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 11:40:18 +01:00
merge branch 'th/infiniband-devname'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1640
This commit is contained in:
commit
b9f84d623d
20 changed files with 101 additions and 124 deletions
|
|
@ -74,7 +74,7 @@ _nft_ifname_valid(const char *str)
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
if (i >= NMP_IFNAMSIZ)
|
||||
if (i >= NM_IFNAMSIZ)
|
||||
return NULL;
|
||||
|
||||
return str;
|
||||
|
|
@ -154,10 +154,10 @@ _share_iptables_get_name(gboolean is_iptables_chain, const char *prefix, const c
|
|||
nm_str_buf_append(&strbuf, prefix);
|
||||
|
||||
ip_iface_len = strlen(ip_iface);
|
||||
G_STATIC_ASSERT_EXPR(NMP_IFNAMSIZ == 16);
|
||||
if (ip_iface_len >= NMP_IFNAMSIZ) {
|
||||
G_STATIC_ASSERT_EXPR(NM_IFNAMSIZ == 16);
|
||||
if (ip_iface_len >= NM_IFNAMSIZ) {
|
||||
nm_assert_not_reached();
|
||||
ip_iface_len = NMP_IFNAMSIZ - 1;
|
||||
ip_iface_len = NM_IFNAMSIZ - 1;
|
||||
}
|
||||
|
||||
if (NM_STRCHAR_ALL(ip_iface,
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ nmtst_platform_ip4_address_full(const char *address,
|
|||
{
|
||||
NMPlatformIP4Address *addr = nmtst_platform_ip4_address(address, peer_address, plen);
|
||||
|
||||
G_STATIC_ASSERT(NMP_IFNAMSIZ == sizeof(addr->label));
|
||||
g_assert(!label || strlen(label) < NMP_IFNAMSIZ);
|
||||
G_STATIC_ASSERT(NM_IFNAMSIZ == sizeof(addr->label));
|
||||
g_assert(!label || strlen(label) < NM_IFNAMSIZ);
|
||||
|
||||
addr->ifindex = ifindex;
|
||||
addr->addr_source = source;
|
||||
|
|
|
|||
|
|
@ -849,7 +849,7 @@ infiniband_partition_add(NMPlatform *platform,
|
|||
parent_device = link_get(platform, parent);
|
||||
g_return_val_if_fail(parent_device != NULL, FALSE);
|
||||
|
||||
nmp_utils_new_infiniband_name(name, parent_device->obj->link.name, p_key);
|
||||
nm_net_devname_infiniband(name, parent_device->obj->link.name, p_key);
|
||||
|
||||
link_add_one(platform, name, NM_LINK_TYPE_INFINIBAND, _infiniband_add_prepare, &d, out_link);
|
||||
return TRUE;
|
||||
|
|
@ -859,12 +859,12 @@ static gboolean
|
|||
infiniband_partition_delete(NMPlatform *platform, int parent, int p_key)
|
||||
{
|
||||
NMFakePlatformLink *parent_device;
|
||||
gs_free char *name = NULL;
|
||||
char name[IFNAMSIZ];
|
||||
|
||||
parent_device = link_get(platform, parent);
|
||||
g_return_val_if_fail(parent_device != NULL, FALSE);
|
||||
|
||||
nmp_utils_new_infiniband_name(name, parent_device->obj->link.name, p_key);
|
||||
nm_net_devname_infiniband(name, parent_device->obj->link.name, p_key);
|
||||
return link_delete(platform, nm_platform_link_get_ifindex(platform, name));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5424,7 +5424,7 @@ parse_infiniband_p_key(shvarFile *ifcfg, int *out_p_key, char **out_parent, GErr
|
|||
* automatically sets.
|
||||
*
|
||||
* NetworkManager supports p-keys without the high bit set. That affects
|
||||
* the interface name (nmp_utils_new_infiniband_name()) and is what
|
||||
* the interface name (nm_net_devname_infiniband()) and is what
|
||||
* we write to "create_child"/"delete_child" sysctl. Kernel will honor
|
||||
* such p-keys for the interface name, but for other purposes it adds the
|
||||
* highest bit. That makes using p-keys without the highest bit odd.
|
||||
|
|
|
|||
|
|
@ -1066,6 +1066,8 @@ write_infiniband_setting(NMConnection *connection,
|
|||
svSetValueStr(ifcfg, "PHYSDEV", parent);
|
||||
|
||||
if (parent && nm_connection_get_interface_name(connection)) {
|
||||
char name[NM_IFNAMSIZ];
|
||||
|
||||
/* The connection.interface-name depends on the p-key. Also,
|
||||
* nm_connection_normalize() will automatically adjust the
|
||||
* interface-name to match the p-key.
|
||||
|
|
@ -1073,8 +1075,8 @@ write_infiniband_setting(NMConnection *connection,
|
|||
* As we patched the p-key above, also anticipate that change, and
|
||||
* don't write a DEVICE= to the file, which would we normalize
|
||||
* differently, when reading it back. */
|
||||
*out_interface_name =
|
||||
nm_setting_infiniband_create_virtual_interface_name(parent, p_key);
|
||||
nm_net_devname_infiniband(name, parent, p_key);
|
||||
*out_interface_name = g_strdup(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ _create_iface_dbus_call_get_interface_cb(GObject *source, GAsyncResult *result,
|
|||
nm_assert(handle->name_owner == priv->name_owner);
|
||||
|
||||
if (!res) {
|
||||
char ifname[NMP_IFNAMSIZ];
|
||||
char ifname[NM_IFNAMSIZ];
|
||||
|
||||
if (handle->create_iface_try_count < CREATE_IFACE_TRY_COUNT_MAX
|
||||
&& nm_dbus_error_is(error, NM_WPAS_ERROR_UNKNOWN_IFACE)
|
||||
|
|
@ -489,7 +489,7 @@ _create_iface_dbus_call_create_interface_cb(GObject *source,
|
|||
gs_unref_variant GVariant *res = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
const char *iface_path_str;
|
||||
char ifname[NMP_IFNAMSIZ];
|
||||
char ifname[NM_IFNAMSIZ];
|
||||
|
||||
res = g_dbus_connection_call_finish(dbus_connection, result, &error);
|
||||
|
||||
|
|
@ -619,7 +619,7 @@ static void
|
|||
_create_iface_dbus_start(NMSupplicantManager *self, NMSupplMgrCreateIfaceHandle *handle)
|
||||
{
|
||||
NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE(self);
|
||||
char ifname[NMP_IFNAMSIZ];
|
||||
char ifname[NM_IFNAMSIZ];
|
||||
|
||||
nm_assert(priv->name_owner);
|
||||
nm_assert(!handle->cancellable);
|
||||
|
|
|
|||
|
|
@ -39,3 +39,37 @@ nm_dhcp_iaid_from_hexstr(const char *str, guint32 *out_value)
|
|||
NM_SET_OUT(out_value, be32toh(iaid.num));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* nm_net_devname_infiniband:
|
||||
* @name: the output-buffer where the value will be written. Must be
|
||||
* not %NULL and point to a string buffer of at least IFNAMSIZ bytes.
|
||||
* @parent_name: the parent interface name
|
||||
* @p_key: the partition key.
|
||||
*
|
||||
* Returns: the infiniband name will be written to @name and @name
|
||||
* is returned.
|
||||
*/
|
||||
const char *
|
||||
nm_net_devname_infiniband(char name[static NM_IFNAMSIZ], const char *parent_name, int p_key)
|
||||
{
|
||||
g_return_val_if_fail(name, NULL);
|
||||
g_return_val_if_fail(parent_name && parent_name[0], NULL);
|
||||
g_return_val_if_fail(strlen(parent_name) < NM_IFNAMSIZ, NULL);
|
||||
|
||||
/* technically, p_key of 0x0000 and 0x8000 is not allowed either. But we don't
|
||||
* want to assert against that in nm_net_devname_infiniband(). So be more
|
||||
* resilient here, and accept those. */
|
||||
g_return_val_if_fail(p_key >= 0 && p_key <= 0xffff, NULL);
|
||||
|
||||
nm_assert(nm_utils_ifname_valid_kernel(parent_name, NULL));
|
||||
|
||||
/* If parent+suffix is too long, kernel would just truncate
|
||||
* the name. We do the same. See ipoib_vlan_add(). */
|
||||
g_snprintf(name, NM_IFNAMSIZ, "%s.%04x", parent_name, p_key);
|
||||
|
||||
nm_assert(nm_utils_ifname_valid_kernel(name, NULL));
|
||||
|
||||
return name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -432,4 +432,9 @@ char *nm_dhcp_iaid_to_hexstr(guint32 iaid, char buf[static NM_DHCP_IAID_TO_HEXST
|
|||
|
||||
gboolean nm_dhcp_iaid_from_hexstr(const char *str, guint32 *out_value);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *
|
||||
nm_net_devname_infiniband(char name[static NM_IFNAMSIZ], const char *parent_name, int p_key);
|
||||
|
||||
#endif /* __NM_LIBNM_BASE_H__ */
|
||||
|
|
|
|||
|
|
@ -36,9 +36,7 @@ typedef struct {
|
|||
char *mac_address;
|
||||
char *transport_mode;
|
||||
char *parent;
|
||||
char *virtual_iface_name;
|
||||
gsize virtual_iface_name_parent_length;
|
||||
gint32 virtual_iface_name_p_key;
|
||||
char virtual_iface_name[NM_IFNAMSIZ];
|
||||
gint32 p_key;
|
||||
guint32 mtu;
|
||||
} NMSettingInfinibandPrivate;
|
||||
|
|
@ -145,17 +143,6 @@ nm_setting_infiniband_get_parent(NMSettingInfiniband *setting)
|
|||
return NM_SETTING_INFINIBAND_GET_PRIVATE(setting)->parent;
|
||||
}
|
||||
|
||||
char *
|
||||
nm_setting_infiniband_create_virtual_interface_name(const char *parent, int p_key)
|
||||
{
|
||||
char *s;
|
||||
|
||||
s = g_strdup_printf("%s.%04x", parent, (guint) p_key);
|
||||
if (strlen(s) >= NMP_IFNAMSIZ)
|
||||
s[NMP_IFNAMSIZ - 1] = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* nm_setting_infiniband_get_virtual_interface_name:
|
||||
* @setting: the #NMSettingInfiniband
|
||||
|
|
@ -170,25 +157,11 @@ const char *
|
|||
nm_setting_infiniband_get_virtual_interface_name(NMSettingInfiniband *setting)
|
||||
{
|
||||
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE(setting);
|
||||
gsize len;
|
||||
|
||||
if (priv->p_key == -1 || !priv->parent) {
|
||||
nm_clear_g_free(&priv->virtual_iface_name);
|
||||
if (priv->p_key == -1 || !priv->parent)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = strlen(priv->parent);
|
||||
if (!priv->virtual_iface_name || priv->virtual_iface_name_p_key != priv->p_key
|
||||
|| priv->virtual_iface_name_parent_length != len
|
||||
|| memcmp(priv->parent, priv->virtual_iface_name, len) != 0) {
|
||||
priv->virtual_iface_name_p_key = priv->p_key;
|
||||
priv->virtual_iface_name_parent_length = len;
|
||||
g_free(priv->virtual_iface_name);
|
||||
priv->virtual_iface_name =
|
||||
nm_setting_infiniband_create_virtual_interface_name(priv->parent, priv->p_key);
|
||||
}
|
||||
|
||||
return priv->virtual_iface_name;
|
||||
return nm_net_devname_infiniband(priv->virtual_iface_name, priv->parent, priv->p_key);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
@ -352,16 +325,6 @@ nm_setting_infiniband_new(void)
|
|||
return g_object_new(NM_TYPE_SETTING_INFINIBAND, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE(object);
|
||||
|
||||
g_free(priv->virtual_iface_name);
|
||||
|
||||
G_OBJECT_CLASS(nm_setting_infiniband_parent_class)->finalize(object);
|
||||
}
|
||||
|
||||
static void
|
||||
nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
|
||||
{
|
||||
|
|
@ -373,7 +336,6 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
|
|||
|
||||
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||
object_class->finalize = finalize;
|
||||
|
||||
setting_class->verify = verify;
|
||||
|
||||
|
|
|
|||
|
|
@ -6255,14 +6255,16 @@ test_connection_normalize_infiniband(void)
|
|||
nmtst_connection_normalize(con);
|
||||
g_assert_cmpstr(nm_connection_get_interface_name(con), ==, "x234567890123.0");
|
||||
|
||||
#define iface_name(parent, p_key, expected) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
gs_free char *_s = nm_setting_infiniband_create_virtual_interface_name((parent), (p_key)); \
|
||||
\
|
||||
g_assert(nm_utils_ifname_valid_kernel(_s, NULL)); \
|
||||
g_assert_cmpstr(_s, ==, (expected)); \
|
||||
} \
|
||||
#define iface_name(parent, p_key, expected) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
char _name[NM_IFNAMSIZ]; \
|
||||
\
|
||||
nm_net_devname_infiniband(_name, (parent), (p_key)); \
|
||||
\
|
||||
g_assert(nm_utils_ifname_valid_kernel(_name, NULL)); \
|
||||
g_assert_cmpstr(_name, ==, (expected)); \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
||||
iface_name("foo", 15, "foo.000f");
|
||||
|
|
|
|||
|
|
@ -323,8 +323,6 @@ typedef gpointer (*NMUtilsCopyFunc)(gpointer);
|
|||
const char **
|
||||
_nm_ip_address_get_attribute_names(const NMIPAddress *addr, gboolean sorted, guint *out_length);
|
||||
|
||||
char *nm_setting_infiniband_create_virtual_interface_name(const char *parent, int p_key);
|
||||
|
||||
#define NM_SETTING_WIRED_S390_OPTION_MAX_LEN 200u
|
||||
|
||||
void _nm_setting_wired_clear_s390_options(NMSettingWired *setting);
|
||||
|
|
|
|||
|
|
@ -9387,7 +9387,7 @@ _infiniband_partition_action(NMPlatform *platform,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
nmp_utils_new_infiniband_name(name, ifname_parent, p_key);
|
||||
nm_net_devname_infiniband(name, ifname_parent, p_key);
|
||||
do_request_link(platform, 0, name);
|
||||
|
||||
if (action == INFINIBAND_ACTION_DELETE_CHILD)
|
||||
|
|
|
|||
|
|
@ -2064,35 +2064,6 @@ nmp_utils_new_vlan_name(const char *parent_iface, guint32 vlan_id)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* nmp_utils_new_infiniband_name:
|
||||
* @name: the output-buffer where the value will be written. Must be
|
||||
* not %NULL and point to a string buffer of at least IFNAMSIZ bytes.
|
||||
* @parent_name: the parent interface name
|
||||
* @p_key: the partition key.
|
||||
*
|
||||
* Returns: the infiniband name will be written to @name and @name
|
||||
* is returned.
|
||||
*/
|
||||
const char *
|
||||
nmp_utils_new_infiniband_name(char *name, const char *parent_name, int p_key)
|
||||
{
|
||||
g_return_val_if_fail(name, NULL);
|
||||
g_return_val_if_fail(parent_name && parent_name[0], NULL);
|
||||
g_return_val_if_fail(strlen(parent_name) < IFNAMSIZ, NULL);
|
||||
|
||||
/* technically, p_key of 0x0000 and 0x8000 is not allowed either. But we don't
|
||||
* want to assert against that in nmp_utils_new_infiniband_name(). So be more
|
||||
* resilient here, and accept those. */
|
||||
g_return_val_if_fail(p_key >= 0 && p_key <= 0xffff, NULL);
|
||||
|
||||
/* If parent+suffix is too long, kernel would just truncate
|
||||
* the name. We do the same. See ipoib_vlan_add(). */
|
||||
g_snprintf(name, IFNAMSIZ, "%s.%04x", parent_name, p_key);
|
||||
return name;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* Takes a pair @timestamp and @duration, and returns the remaining duration based
|
||||
* on the new timestamp @now.
|
||||
|
|
|
|||
|
|
@ -77,8 +77,7 @@ int nmp_utils_if_nametoindex(const char *ifname);
|
|||
|
||||
int nmp_utils_sysctl_open_netdir(int ifindex, const char *ifname_guess, char *out_ifname);
|
||||
|
||||
char *nmp_utils_new_vlan_name(const char *parent_iface, guint32 vlan_id);
|
||||
const char *nmp_utils_new_infiniband_name(char *name, const char *parent_name, int p_key);
|
||||
char *nmp_utils_new_vlan_name(const char *parent_iface, guint32 vlan_id);
|
||||
|
||||
guint32
|
||||
nmp_utils_lifetime_rebase_relative_time_on_now(guint32 timestamp, guint32 duration, gint32 now);
|
||||
|
|
|
|||
|
|
@ -2999,7 +2999,7 @@ _infiniband_add_add_or_delete(NMPlatform *self,
|
|||
if (parent_link->type != NM_LINK_TYPE_INFINIBAND)
|
||||
return -NME_PL_WRONG_TYPE;
|
||||
|
||||
nmp_utils_new_infiniband_name(name, parent_link->name, p_key);
|
||||
nm_net_devname_infiniband(name, parent_link->name, p_key);
|
||||
|
||||
if (add) {
|
||||
r = _link_add_check_existing(self, name, NM_LINK_TYPE_INFINIBAND, out_link);
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ typedef union {
|
|||
|
||||
struct _NMPlatformLink {
|
||||
__NMPlatformObjWithIfindex_COMMON;
|
||||
char name[NMP_IFNAMSIZ];
|
||||
char name[NM_IFNAMSIZ];
|
||||
NMLinkType type;
|
||||
|
||||
/* rtnl_link_get_type(), IFLA_INFO_KIND. */
|
||||
|
|
@ -545,8 +545,8 @@ typedef struct {
|
|||
NMFibRuleUidRange uid_range; /* FRA_UID_RANGE */
|
||||
NMFibRulePortRange sport_range; /* FRA_SPORT_RANGE */
|
||||
NMFibRulePortRange dport_range; /* FRA_DPORT_RANGE */
|
||||
char iifname[NMP_IFNAMSIZ]; /* FRA_IIFNAME */
|
||||
char oifname[NMP_IFNAMSIZ]; /* FRA_OIFNAME */
|
||||
char iifname[NM_IFNAMSIZ]; /* FRA_IIFNAME */
|
||||
char oifname[NM_IFNAMSIZ]; /* FRA_OIFNAME */
|
||||
guint8 addr_family; /* (struct fib_rule_hdr).family */
|
||||
guint8 action; /* (struct fib_rule_hdr).action */
|
||||
guint8 tos; /* (struct fib_rule_hdr).tos */
|
||||
|
|
@ -1534,23 +1534,23 @@ const char *nm_link_type_to_string(NMLinkType link_type);
|
|||
|
||||
#define NMP_SYSCTL_PATHID_ABSOLUTE(path) ((const char *) NULL), -1, (path)
|
||||
|
||||
#define NMP_SYSCTL_PATHID_NETDIR_unsafe(dirfd, ifname, path) \
|
||||
nm_sprintf_buf_unsafe_a(NM_STRLEN("net:/sys/class/net//\0") + NMP_IFNAMSIZ + ({ \
|
||||
const gsize _l = strlen(path); \
|
||||
\
|
||||
nm_assert(_l < 200); \
|
||||
_l; \
|
||||
}), \
|
||||
"net:/sys/class/net/%s/%s", \
|
||||
(ifname), \
|
||||
(path)), \
|
||||
#define NMP_SYSCTL_PATHID_NETDIR_unsafe(dirfd, ifname, path) \
|
||||
nm_sprintf_buf_unsafe_a(NM_STRLEN("net:/sys/class/net//\0") + NM_IFNAMSIZ + ({ \
|
||||
const gsize _l = strlen(path); \
|
||||
\
|
||||
nm_assert(_l < 200); \
|
||||
_l; \
|
||||
}), \
|
||||
"net:/sys/class/net/%s/%s", \
|
||||
(ifname), \
|
||||
(path)), \
|
||||
(dirfd), (path)
|
||||
|
||||
#define NMP_SYSCTL_PATHID_NETDIR(dirfd, ifname, path) \
|
||||
nm_sprintf_bufa(NM_STRLEN("net:/sys/class/net//" path "/\0") + NMP_IFNAMSIZ, \
|
||||
"net:/sys/class/net/%s/%s", \
|
||||
(ifname), \
|
||||
path), \
|
||||
#define NMP_SYSCTL_PATHID_NETDIR(dirfd, ifname, path) \
|
||||
nm_sprintf_bufa(NM_STRLEN("net:/sys/class/net//" path "/\0") + NM_IFNAMSIZ, \
|
||||
"net:/sys/class/net/%s/%s", \
|
||||
(ifname), \
|
||||
path), \
|
||||
(dirfd), ("" path "")
|
||||
|
||||
int nm_platform_sysctl_open_netdir(NMPlatform *self, int ifindex, char *out_ifname);
|
||||
|
|
|
|||
|
|
@ -11,12 +11,6 @@
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* IFNAMSIZ is both defined in <linux/if.h> and <net/if.h>. In the past, these
|
||||
* headers conflicted, so we cannot simply include either of them in a header-file.*/
|
||||
#define NMP_IFNAMSIZ 16
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Define of the IN6_ADDR_GEN_MODE_* values to workaround old kernel headers
|
||||
* that don't define it. */
|
||||
#define NM_IN6_ADDR_GEN_MODE_UNKNOWN 255 /* no corresponding value. */
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ struct _NMPlatformIP4Address {
|
|||
* See nm_platform_ip4_broadcast_address_from_addr(). */
|
||||
in_addr_t broadcast_address;
|
||||
|
||||
char label[NMP_IFNAMSIZ];
|
||||
char label[NM_IFNAMSIZ];
|
||||
|
||||
/* Whether the address is ready to be configured. By default, an address is, but this
|
||||
* flag may indicate that the address is just for tracking purpose only, but the ACD
|
||||
|
|
|
|||
|
|
@ -1367,6 +1367,12 @@ nm_ptr_to_uintptr(const void *p)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* IFNAMSIZ is both defined in <linux/if.h> and <net/if.h>. In the past, these
|
||||
* headers conflicted, so we cannot simply include either of them in a header-file.*/
|
||||
#define NM_IFNAMSIZ 16
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define NM_AF_UNSPEC 0 /* AF_UNSPEC */
|
||||
#define NM_AF_INET 2 /* AF_INET */
|
||||
#define NM_AF_INET6 10 /* AF_INET6 */
|
||||
|
|
|
|||
|
|
@ -7,9 +7,13 @@
|
|||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <net/if.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
NM_STATIC_ASSERT(NM_IFNAMSIZ == IFNAMSIZ);
|
||||
|
||||
/*****************************************************************************/
|
||||
size_t
|
||||
nm_utils_get_next_realloc_size(bool true_realloc, size_t requested)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue