1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
openmptcprouter-feeds/netifd/patches/084-enlarge-nlmsg-size.patch
2022-04-06 20:55:49 +08:00

26 lines
919 B
Diff

diff -Nur a/system-linux.c netifd-2019-08-05-5e02f944/system-linux.c
--- a/system-linux.c 2020-05-04 12:50:37.870719671 -0700
+++ netifd-2019-08-05-5e02f944/system-linux.c 2020-05-04 12:57:00.512680452 -0700
@@ -2561,8 +2561,7 @@
static int system_add_ip6_tunnel(const char *name, const unsigned int link,
struct blob_attr **tb)
{
- struct nl_msg *nlm = nlmsg_alloc_simple(RTM_NEWLINK,
- NLM_F_REQUEST | NLM_F_REPLACE | NLM_F_CREATE);
+ struct nl_msg *nlm = nlmsg_alloc_size(65536);
struct ifinfomsg ifi = { .ifi_family = AF_UNSPEC };
struct blob_attr *cur;
int ret = 0, ttl = 0;
@@ -2570,6 +2569,12 @@
if (!nlm)
return -1;
+ struct nlmsghdr *new = nlm->nm_nlh;
+ new->nlmsg_type = RTM_NEWLINK;
+ new->nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE | NLM_F_CREATE;
+ new->nlmsg_seq = 0;
+ new->nlmsg_pid = 0;
+
nlmsg_append(nlm, &ifi, sizeof(ifi), 0);
nla_put_string(nlm, IFLA_IFNAME, name);