platform/netlink: also set NETLINK_EXT_ACK for genl socket

There are only two callers of nl_socket_new(). One for NETLINK_GENERIC
and one for NETLINK_ROUTE.

We already were enabling ext-ack for the rtnetlink socket. Also enable
it for the genl socket.

Do that, but just moving this inside nl_socket_new(). I cannot imagine a
case where we don't want this.
This commit is contained in:
Thomas Haller 2022-06-16 20:37:33 +02:00
parent f96fbc8ebe
commit 67d64fd4e5
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 2 additions and 4 deletions

View file

@ -9739,10 +9739,6 @@ constructed(GObject *_object)
nle = nl_socket_set_buffer_size(priv->nlh, 8 * 1024 * 1024, 0);
g_assert(!nle);
nle = nl_socket_set_ext_ack(priv->nlh, TRUE);
if (nle)
_LOGD("could not enable extended acks on netlink socket");
/* explicitly set the msg buffer size and disable MSG_PEEK.
* We use our own receive buffer priv->netlink_recv_buf.
* If we encounter NME_NL_MSG_TRUNC, we will increase the buffer

View file

@ -1101,6 +1101,8 @@ nl_socket_new(struct nl_sock **out_sk, int protocol)
if (local.nl_family != AF_NETLINK)
return -NME_UNSPEC;
(void) nl_socket_set_ext_ack(sk, TRUE);
sk->s_local = local;
sk->s_proto = protocol;