mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 22:50:21 +01:00
platform: put wireguard_family_id in NMPObjectLink
Limit the lifetime of the cached genl family ID to the lifetime of the interface so we correctly handle module reloads. https://github.com/NetworkManager/NetworkManager/pull/161
This commit is contained in:
parent
6c3174f6e0
commit
6ea0cd1300
2 changed files with 6 additions and 6 deletions
|
|
@ -3442,8 +3442,6 @@ typedef struct {
|
|||
|
||||
int is_handling;
|
||||
} delayed_action;
|
||||
|
||||
int wireguard_family_id;
|
||||
} NMLinuxPlatformPrivate;
|
||||
|
||||
struct _NMLinuxPlatform {
|
||||
|
|
@ -6524,10 +6522,10 @@ _wireguard_get_link_properties (NMPlatform *platform, const NMPlatformLink *link
|
|||
};
|
||||
guint i, j;
|
||||
|
||||
if (!priv->wireguard_family_id)
|
||||
priv->wireguard_family_id = _support_genl_family (priv->genl, "wireguard");
|
||||
if (!obj->_link.wireguard_family_id)
|
||||
obj->_link.wireguard_family_id = _support_genl_family (priv->genl, "wireguard");
|
||||
|
||||
if (!priv->wireguard_family_id) {
|
||||
if (!obj->_link.wireguard_family_id) {
|
||||
_LOGD ("wireguard: kernel support not available for wireguard link %s", link->name);
|
||||
goto err;
|
||||
}
|
||||
|
|
@ -6536,7 +6534,7 @@ _wireguard_get_link_properties (NMPlatform *platform, const NMPlatformLink *link
|
|||
if (!msg)
|
||||
goto err;
|
||||
|
||||
if (!genlmsg_put (msg, NL_AUTO_PORT, NL_AUTO_SEQ, priv->wireguard_family_id,
|
||||
if (!genlmsg_put (msg, NL_AUTO_PORT, NL_AUTO_SEQ, obj->_link.wireguard_family_id,
|
||||
0, NLM_F_DUMP, WG_CMD_GET_DEVICE, 1))
|
||||
goto err;
|
||||
|
||||
|
|
|
|||
|
|
@ -167,6 +167,8 @@ typedef struct {
|
|||
|
||||
/* Auxiliary data object for Wi-Fi and WPAN */
|
||||
GObject *ext_data;
|
||||
|
||||
int wireguard_family_id;
|
||||
} NMPObjectLink;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue