diff mbox series

[iptables,6/6] nft: reset netlink sender buffer size of socket restart

Message ID 20190520190822.18873-7-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show
Series ERESTART fixes | expand

Commit Message

Pablo Neira Ayuso May 20, 2019, 7:08 p.m. UTC
Otherwise, mnl_set_sndbuffer() skips the buffer update after socket
restart. Then, sendmsg() fails with EMSGSIZE later on when sending the
batch to the kernel.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 iptables/nft.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/iptables/nft.c b/iptables/nft.c
index 9a3e9fdf4f12..2c61521455de 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -794,6 +794,7 @@  static int nft_restart(struct nft_handle *h)
 		return -1;
 
 	h->portid = mnl_socket_get_portid(h->nl);
+	nlbuffsiz = 0;
 
 	return 0;
 }