platform: drop unnecessary NMPlatformMptcpAddr.in_kernel flag
Since we don't get netlink notifications when the MPTCP endpoints change, we don't cache them. And since we don't cache them, there is less need to mark whether they were received from kernel or created internally.
This commit is contained in:
@@ -7761,14 +7761,12 @@ nm_platform_mptcp_addr_to_string(const NMPlatformMptcpAddr *mptcp_addr, char *bu
|
||||
|
||||
g_snprintf(buf,
|
||||
len,
|
||||
"%s" /* in_kernel */
|
||||
"%s" /* address */
|
||||
"%s" /* port */
|
||||
"%s" /* id */
|
||||
"%s" /* flags */
|
||||
"%s" /* ifindex */
|
||||
"",
|
||||
mptcp_addr->in_kernel ? "" : "[nm] ",
|
||||
str_addr,
|
||||
mptcp_addr->port == 0 ? "" : nm_sprintf_buf(str_port, " port %u", mptcp_addr->port),
|
||||
mptcp_addr->id == 0 ? "" : nm_sprintf_buf(str_id, " id %u", mptcp_addr->id),
|
||||
@@ -7785,13 +7783,7 @@ nm_platform_mptcp_addr_hash_update(const NMPlatformMptcpAddr *obj, NMHashState *
|
||||
nm_assert(obj);
|
||||
nm_assert_addr_family_or_unspec(obj->addr_family);
|
||||
|
||||
nm_hash_update_vals(h,
|
||||
obj->id,
|
||||
obj->flags,
|
||||
obj->port,
|
||||
obj->addr_family,
|
||||
(bool) obj->in_kernel,
|
||||
obj->ifindex);
|
||||
nm_hash_update_vals(h, obj->id, obj->flags, obj->port, obj->addr_family, obj->ifindex);
|
||||
if (NM_IN_SET(obj->addr_family, AF_INET, AF_INET6))
|
||||
nm_hash_update(h, &obj->addr, nm_utils_addr_family_to_size(obj->addr_family));
|
||||
}
|
||||
@@ -7806,7 +7798,6 @@ nm_platform_mptcp_addr_cmp(const NMPlatformMptcpAddr *a, const NMPlatformMptcpAd
|
||||
|
||||
NM_CMP_FIELD(a, b, ifindex);
|
||||
NM_CMP_FIELD(a, b, id);
|
||||
NM_CMP_FIELD_UNSAFE(a, b, in_kernel);
|
||||
NM_CMP_FIELD(a, b, addr_family);
|
||||
if (NM_IN_SET(a->addr_family, AF_INET, AF_INET6))
|
||||
NM_CMP_FIELD_MEMCMP_LEN(a, b, addr, nm_utils_addr_family_to_size(a->addr_family));
|
||||
|
@@ -1098,21 +1098,11 @@ typedef void (*NMPlatformAsyncCallback)(GError *error, gpointer user_data);
|
||||
|
||||
typedef struct {
|
||||
__NMPlatformObjWithIfindex_COMMON;
|
||||
|
||||
guint32 id;
|
||||
guint32 flags;
|
||||
guint16 port;
|
||||
NMIPAddr addr;
|
||||
gint8 addr_family;
|
||||
|
||||
/* If TRUE, then the instance was received by kernel and is inside NMPlatform
|
||||
* cache. In that case, the "id" is set and acts as primary key for the instance.
|
||||
*
|
||||
* If FALSE, this instance is not yet configured in kernel. In this case,
|
||||
* the tuple (id, addr_family, addr) is the primary key of the instance.
|
||||
* This way, we can track mptcp addresses in NetworkManager internally,
|
||||
* before configuring them in kernel. */
|
||||
bool in_kernel : 1;
|
||||
} NMPlatformMptcpAddr;
|
||||
|
||||
#undef __NMPlatformObjWithIfindex_COMMON
|
||||
|
Reference in New Issue
Block a user