diff options
Diffstat (limited to 'src/platform/nm-netlink.c')
-rw-r--r-- | src/platform/nm-netlink.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/platform/nm-netlink.c b/src/platform/nm-netlink.c index 7d794f7737..0baaaf0b47 100644 --- a/src/platform/nm-netlink.c +++ b/src/platform/nm-netlink.c @@ -38,6 +38,10 @@ #define NL_MSG_PEEK_EXPLICIT (1<<4) #define NL_NO_AUTO_ACK (1<<5) +#ifndef NETLINK_EXT_ACK +#define NETLINK_EXT_ACK 11 +#endif + #define NL_MSG_CRED_PRESENT 1 struct nl_msg { @@ -933,6 +937,22 @@ nl_socket_add_memberships (struct nl_sock *sk, int group, ...) return 0; } +int +nl_socket_set_ext_ack (struct nl_sock *sk, gboolean enable) +{ + int err; + + if (sk->s_fd == -1) + return -NLE_BAD_SOCK; + + enable = !!enable; + err = setsockopt (sk->s_fd, SOL_NETLINK, NETLINK_EXT_ACK, &enable, sizeof (enable)); + if (err < 0) + return -nl_syserr2nlerr (errno); + + return 0; +} + void nl_socket_disable_msg_peek (struct nl_sock *sk) { sk->s_flags |= NL_MSG_PEEK_EXPLICIT; |