mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-19 07:48:30 +02:00
platform/netlink: add nm_auto_nlsock cleanup macro
This commit is contained in:
parent
612528af89
commit
4a22abdda1
1 changed files with 4 additions and 5 deletions
|
|
@ -413,11 +413,7 @@ void nlmsg_set_src(struct nl_msg *msg, struct sockaddr_nl *addr);
|
|||
struct ucred *nlmsg_get_creds(struct nl_msg *msg);
|
||||
void nlmsg_set_creds(struct nl_msg *msg, struct ucred *creds);
|
||||
|
||||
static inline void
|
||||
_nm_auto_nl_msg_cleanup(struct nl_msg **ptr)
|
||||
{
|
||||
nlmsg_free(*ptr);
|
||||
}
|
||||
NM_AUTO_DEFINE_FCN0(struct nl_msg *, _nm_auto_nl_msg_cleanup, nlmsg_free);
|
||||
#define nm_auto_nlmsg nm_auto(_nm_auto_nl_msg_cleanup)
|
||||
|
||||
static inline void *
|
||||
|
|
@ -496,6 +492,9 @@ struct nl_sock *nl_socket_alloc(void);
|
|||
|
||||
void nl_socket_free(struct nl_sock *sk);
|
||||
|
||||
NM_AUTO_DEFINE_FCN0(struct nl_sock *, _nm_auto_nlsock, nl_socket_free);
|
||||
#define nm_auto_nlsock nm_auto(_nm_auto_nlsock)
|
||||
|
||||
int nl_socket_get_fd(const struct nl_sock *sk);
|
||||
|
||||
struct sockaddr_nl *nlmsg_get_dst(struct nl_msg *msg);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue