wg-linux: increase default messages size
authorFelix Fietkau <nbd@nbd.name>
Wed, 31 May 2023 08:41:16 +0000 (10:41 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 31 May 2023 08:41:17 +0000 (10:41 +0200)
Makes the need for splitting messages less likely

Signed-off-by: Felix Fietkau <nbd@nbd.name>
wg-linux.c

index 35365e5539b707b9aa84cd91ca8eb4966ffec072..0a17c90bac7a79fc28335cba4391ce4fa69f511c 100644 (file)
@@ -44,10 +44,19 @@ static struct unl unl;
 static int
 wg_nl_init(void)
 {
+       int ret;
+
        if (unl.sock)
                return 0;
 
-       return unl_genl_init(&unl, "wireguard");
+       ret = unl_genl_init(&unl, "wireguard");
+       if (ret)
+               return ret;
+
+       nl_socket_set_buffer_size(unl.sock, 32768, 32768);
+       nlmsg_set_default_size(32768);
+
+       return 0;
 }
 
 static struct nl_msg *