diff options
author | Thomas Haller <thaller@redhat.com> | 2022-08-02 19:17:28 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-08-09 08:02:46 +0200 |
commit | 370147cf9da093cffc50cf2a298ef2a49d93fe06 (patch) | |
tree | 652dcbbaf303e3793e7306e3ea81f97be4fb39aa | |
parent | e1c18e9ed2cc2f5ddaeeb79191f01d56d8010ef2 (diff) | |
download | NetworkManager-370147cf9da093cffc50cf2a298ef2a49d93fe06.tar.gz |
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.
-rw-r--r-- | src/libnm-platform/nm-platform.c | 11 | ||||
-rw-r--r-- | src/libnm-platform/nm-platform.h | 10 |
2 files changed, 1 insertions, 20 deletions
diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index 987b8f2dd2..cceabb7f9b 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -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)); diff --git a/src/libnm-platform/nm-platform.h b/src/libnm-platform/nm-platform.h index 2f41b0c8bf..367f4316d1 100644 --- a/src/libnm-platform/nm-platform.h +++ b/src/libnm-platform/nm-platform.h @@ -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 |