knxd: fix compilation with newer glibc 17534/head
authorRosen Penev <rosenp@gmail.com>
Sun, 9 Jan 2022 04:34:27 +0000 (20:34 -0800)
committerRosen Penev <rosenp@gmail.com>
Sun, 9 Jan 2022 04:41:13 +0000 (20:41 -0800)
the link variable conflicts with the link() function.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/knxd/Makefile
net/knxd/patches/010-link.patch [new file with mode: 0644]

index 2781e6a458a5927659c6090f97df02bdc3f1cd9c..6c93b78ce8babd59744a426720fcad978971dcf2 100644 (file)
@@ -12,7 +12,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knxd
 PKG_VERSION:=0.14.52
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/knxd/knxd/tar.gz/$(PKG_VERSION)?
diff --git a/net/knxd/patches/010-link.patch b/net/knxd/patches/010-link.patch
new file mode 100644 (file)
index 0000000..787f707
--- /dev/null
@@ -0,0 +1,138 @@
+--- a/src/server/knxd_args.cpp
++++ b/src/server/knxd_args.cpp
+@@ -68,13 +68,13 @@ struct L2options
+ } while(0)
+ IniData ini;
+-char link[99] = "@.";
++char link2[99] = "@.";
+ void link_to(const char *arg)
+ {
+   char *p;
+-  ++*link;
+-  strcpy(link+2,arg);
+-  p = strchr(link+2,':');
++  ++*link2;
++  strcpy(link2+2,arg);
++  p = strchr(link2+2,':');
+   if (p)
+     *p = 0;
+ }
+@@ -163,10 +163,10 @@ public:
+       {
+         link_to(name);
+         ITER(i, more_args)
+-        (*ini[link])[i->first] = i->second;
+-        (*ini[link])["filter"] = name;
++        (*ini[link2])[i->first] = i->second;
++        (*ini[link2])["filter"] = name;
+         more_args.clear();
+-        filters.push_back(link);
++        filters.push_back(link2);
+       }
+     else
+       filters.push_back(name);
+@@ -232,7 +232,7 @@ void driver_argsv(const char *arg, char
+ {
+   va_list apl;
+   va_start(apl, ap);
+-  (*ini[link])["driver"] = arg;
++  (*ini[link2])["driver"] = arg;
+   char *pa = NULL;
+   while(ap)
+@@ -250,7 +250,7 @@ void driver_argsv(const char *arg, char
+       if (*pa == '!') // required-argument flag
+         pa++;
+       if (*ap) // skip empty arguments
+-        (*ini[link])[pa] = ap;
++        (*ini[link2])[pa] = ap;
+       ap = p2;
+     }
+   if (pa != NULL)
+@@ -280,7 +280,7 @@ void driver_args(const char *arg, char *
+   else if(!strcmp(arg,"iptn"))
+     {
+       driver_argsv("ipt",ap, "!ip-address","dest-port","src-port","nat-ip","data-port", NULL);
+-      (*ini[link])["nat"] = "true";
++      (*ini[link2])["nat"] = "true";
+     }
+   else if(!strcmp(arg,"ft12") || !strcmp(arg,"ncn5120") || !strcmp(arg,"tpuarts") || !strcmp(arg,"ft12cemi") || !strcmp(arg,"tpuart"))
+     {
+@@ -556,18 +556,18 @@ parse_opt (int key, char *arg, struct ar
+       if (arguments->want_server)
+         die("You need -S after -D/-T/-R");
+       link_to("unix");
+-      ADD((*ini["main"])["connections"], link);
+-      (*ini[link])["server"] = "knxd_unix";
++      ADD((*ini["main"])["connections"], link2);
++      (*ini[link2])["server"] = "knxd_unix";
+       // (*ini[link])["driver"] = "knx-link";
+       const char *name = OPT_ARG(arg,state,NULL);
+       if (name)
+         {
+-          (*ini[link])["path"] = name;
+-          (*ini[link])["systemd-ignore"] = "false";
++          (*ini[link2])["path"] = name;
++          (*ini[link2])["systemd-ignore"] = "false";
+         }
+       else
+-        (*ini[link])["systemd-ignore"] = "true";
+-      arguments->stack(link);
++        (*ini[link2])["systemd-ignore"] = "true";
++      arguments->stack(link2);
+     }
+     break;
+@@ -576,19 +576,19 @@ parse_opt (int key, char *arg, struct ar
+       if (arguments->want_server)
+         die("You need -S after -D/-T/-R");
+       link_to("tcp");
+-      ADD((*ini["main"])["connections"], link);
+-      (*ini[link])["server"] = "knxd_tcp";
++      ADD((*ini["main"])["connections"], link2);
++      (*ini[link2])["server"] = "knxd_tcp";
+       // (*ini[link])["driver"] = "knx-link";
+       const char *port = OPT_ARG(arg,state,"");
+       if (*port && atoi(port) > 0)
+         {
+-          (*ini[link])["port"] = port;
+-          (*ini[link])["systemd-ignore"] = "false";
++          (*ini[link2])["port"] = port;
++          (*ini[link2])["systemd-ignore"] = "false";
+         }
+       else
+-        (*ini[link])["systemd-ignore"] = "true";
++        (*ini[link2])["systemd-ignore"] = "true";
+-      arguments->stack(link);
++      arguments->stack(link2);
+     }
+     break;
+@@ -635,8 +635,8 @@ parse_opt (int key, char *arg, struct ar
+         die("You cannot apply flags to the group cache.");
+       link_to("cache");
+-      (*ini["main"])["cache"] = link;
+-      arguments->stack(link);
++      (*ini["main"])["cache"] = link2;
++      arguments->stack(link2);
+       break;
+     case OPT_FORCE_BROADCAST:
+       (*ini["main"])["force-broadcast"] = "true";
+@@ -675,12 +675,12 @@ parse_opt (int key, char *arg, struct ar
+       if (arguments->want_server)
+         die("You need -S after -D/-T/-R");
+       link_to(arg);
+-      ADD((*ini["main"])["connections"], link);
++      ADD((*ini["main"])["connections"], link2);
+       char *ap = strchr(arg,':');
+       if (ap)
+         *ap++ = '\0';
+       driver_args(arg,ap);
+-      arguments->stack(link);
++      arguments->stack(link2);
+       break;
+     }
+     case 'B':