platform/netlink: drop nl_socket_set_ext_ack() API

We just always want to set this. No need for a setter that is only
called once.
This commit is contained in:
Thomas Haller 2022-06-23 18:40:20 +02:00
parent 9cd986ba2e
commit 4f405c5a07
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
3 changed files with 3 additions and 20 deletions

View file

@ -1032,22 +1032,6 @@ 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;
int val;
nm_assert_sk(sk);
val = !!enable;
err = setsockopt(sk->s_fd, SOL_NETLINK, NETLINK_EXT_ACK, &val, sizeof(val));
if (err < 0)
return -nm_errno_from_native(errno);
return 0;
}
/*****************************************************************************/
int
@ -1064,6 +1048,7 @@ nl_socket_new(struct nl_sock **out_sk,
int nmerr;
socklen_t addrlen;
struct sockaddr_nl local = {0};
int i_val;
nm_assert(out_sk && !*out_sk);
@ -1102,7 +1087,8 @@ nl_socket_new(struct nl_sock **out_sk,
if (nmerr < 0)
return nmerr;
(void) nl_socket_set_ext_ack(sk, TRUE);
i_val = 1;
(void) setsockopt(sk->s_fd, SOL_NETLINK, NETLINK_EXT_ACK, &i_val, sizeof(i_val));
if (NM_FLAGS_HAS(flags, NL_SOCKET_FLAGS_PASSCRED)) {
err = nl_socket_set_passcred(sk, 1);

View file

@ -607,8 +607,6 @@ int nl_recvmsgs(struct nl_sock *sk, const struct nl_cb *cb);
int nl_wait_for_ack(struct nl_sock *sk, const struct nl_cb *cb);
int nl_socket_set_ext_ack(struct nl_sock *sk, gboolean enable);
/*****************************************************************************/
void *genlmsg_put(struct nl_msg *msg,

View file

@ -70,7 +70,6 @@ test_use_symbols(void)
(void (*)(void)) nl_socket_set_nonblocking,
(void (*)(void)) nl_socket_set_buffer_size,
(void (*)(void)) nl_socket_add_memberships,
(void (*)(void)) nl_socket_set_ext_ack,
(void (*)(void)) nl_wait_for_ack,
(void (*)(void)) nl_recvmsgs,
(void (*)(void)) nl_sendmsg,