mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-27 17:30:42 +01:00
platform: add _nlmsg_is_del() helper to _rtnl_handle_msg()
I minor refactoring. It slightly seems preferable to me.
This commit is contained in:
parent
3e8ec66df6
commit
330343cf0b
1 changed files with 18 additions and 11 deletions
|
|
@ -4690,6 +4690,23 @@ nmp_object_new_from_nl(NMPlatform *platform,
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_nlmsg_is_del(guint16 nlmsg_type)
|
||||
{
|
||||
if (NM_IN_SET(nlmsg_type,
|
||||
RTM_DELLINK,
|
||||
RTM_DELADDR,
|
||||
RTM_DELROUTE,
|
||||
RTM_DELRULE,
|
||||
RTM_DELQDISC,
|
||||
RTM_DELTFILTER)) {
|
||||
/* The event notifies about a deleted object. We don't need to initialize all
|
||||
* fields of the object. */
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
|
|
@ -7921,17 +7938,7 @@ _rtnl_handle_msg(NMPlatform *platform, const struct nl_msg_lite *msg)
|
|||
|
||||
msghdr = msg->nm_nlh;
|
||||
|
||||
if (NM_IN_SET(msghdr->nlmsg_type,
|
||||
RTM_DELLINK,
|
||||
RTM_DELADDR,
|
||||
RTM_DELROUTE,
|
||||
RTM_DELRULE,
|
||||
RTM_DELQDISC,
|
||||
RTM_DELTFILTER)) {
|
||||
/* The event notifies about a deleted object. We don't need to initialize all
|
||||
* fields of the object. */
|
||||
is_del = TRUE;
|
||||
}
|
||||
is_del = _nlmsg_is_del(msghdr->nlmsg_type);
|
||||
|
||||
parse_nlmsg_iter = (ParseNlmsgIter){
|
||||
.iter_more = FALSE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue