summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-09-08 15:07:49 +0200
committerThomas Haller <thaller@redhat.com>2020-09-11 10:48:14 +0200
commitd72402b962c92e65c0f31b75b88edec28192f2bd (patch)
tree8a70e68933f12b508c5833b442e56439153df191 /src
parent26d2517d5f89a18f37e2cbb4a1a5321d68dad0a1 (diff)
downloadNetworkManager-d72402b962c92e65c0f31b75b88edec28192f2bd.tar.gz
l3cfg: add nm_l3cfg_get_pllink() helper
NML3Cfg already keeps track of the current NMPlatformLink object. Allow accessing it directly from an NML3Cfg instance, which saves a cache lookup from NMPlatform.
Diffstat (limited to 'src')
-rw-r--r--src/nm-l3cfg.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nm-l3cfg.h b/src/nm-l3cfg.h
index 4a3bab1111..13830073a2 100644
--- a/src/nm-l3cfg.h
+++ b/src/nm-l3cfg.h
@@ -87,6 +87,28 @@ nm_l3cfg_get_ifname (const NML3Cfg *self)
return nmp_object_link_get_ifname (self->priv.pllink);
}
+static inline const NMPObject *
+nm_l3cfg_get_plobj (const NML3Cfg *self)
+{
+ if (!self)
+ return NULL;
+
+ nm_assert (NM_IS_L3CFG (self));
+
+ return self->priv.pllink;
+}
+
+static inline const NMPlatformLink *
+nm_l3cfg_get_pllink (const NML3Cfg *self)
+{
+ if (!self)
+ return NULL;
+
+ nm_assert (NM_IS_L3CFG (self));
+
+ return NMP_OBJECT_CAST_LINK (self->priv.pllink);
+}
+
static inline NMNetns *
nm_l3cfg_get_netns (const NML3Cfg *self)
{