Skip to contentSkip to conversation

Raising the size of the buffer holding nl messages

PATCH New Jetchko Jekov 1 participant 1 message May 21, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Raising the size of the buffer holding nl messages

Quoted 1 line

From 68f0dda45a4f1bca070849f3f04a409de897ee0f Mon Sep 17 00:00:00 2001

From: Jetchko Jekov <[email protected]>
Date: Thu, 21 May 2015 16:32:24 +0200
Subject: [PATCH] Raising the size of the buffer holding nl messages.

Now it matches the size for the answer defined in rtnl_talk() and prevents stack corruption with answer > 1024 bytes.

---
 ip/link_gre.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/link_gre.c +1 -1
index 1d78387..1937261 100644
@@ -53,7 +53,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
 	struct {
 		struct nlmsghdr n;
 		struct ifinfomsg i;
-		char buf[1024];
+		char buf[16384];
 	} req;
 	struct ifinfomsg *ifi = (struct ifinfomsg *)(n + 1);
 	struct rtattr *tb[IFLA_MAX + 1];
Signature · 1 line
2.1.0