port-mirroring: Fix compilation with GCC8
authorRosen Penev <redacted>
Fri, 3 May 2019 03:27:48 +0000 (20:27 -0700)
committerRosen Penev <redacted>
Thu, 16 May 2019 20:32:54 +0000 (13:32 -0700)
Signed-off-by: Rosen Penev <redacted>
net/port-mirroring/Makefile
net/port-mirroring/patches/010-snprintf-to-strncpy.patch [new file with mode: 0644]

index 6c32174ee945f3085185056a44d6b4d4dd49888c..a001e47edc6787516aa4dd61b9e816b4dc6408f5 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=port-mirroring
 PKG_VERSION:=1.4.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/mmaraya/port-mirroring/tar.gz/v$(PKG_VERSION)?
diff --git a/net/port-mirroring/patches/010-snprintf-to-strncpy.patch b/net/port-mirroring/patches/010-snprintf-to-strncpy.patch
new file mode 100644 (file)
index 0000000..d28c2e2
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/src/main.c
++++ b/src/main.c
+@@ -90,7 +90,7 @@ int loadCfg(const char *fpath)
+                 }
+                 else
+                 {
+-                    snprintf(cfg.dst_if, IFNAMSIZ, "%s", value);
++                    strncpy(cfg.dst_if, value, IFNAMSIZ);
+                     cfg.flags |= PM_DST_IF;
+                 }
+             }
+@@ -104,7 +104,7 @@ int loadCfg(const char *fpath)
+             }
+             else if (strcmp(option, "filter") == 0)
+             {
+-                snprintf(cfg.pfe, PFE_MAX, "%s", value);
++                strncpy(cfg.pfe, value, PFE_MAX);
+             }
+             else if (strcmp(option, "promiscuous") == 0)
+             {
git clone https://git.99rst.org/PROJECT