From 2c71d5bcd4e09b926d63d0fbba39534fd2c587f7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 28 Mar 2020 20:58:11 -0700 Subject: [PATCH] port-mirroring: fix compilation under newer musl time_t is 64-bit under 32-bit OSes with version 1.2.0. Fixes wrong pointer error. Signed-off-by: Rosen Penev --- net/port-mirroring/Makefile | 2 +- net/port-mirroring/patches/020-time.patch | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 net/port-mirroring/patches/020-time.patch diff --git a/net/port-mirroring/Makefile b/net/port-mirroring/Makefile index a001e47ed..0dce495c3 100644 --- a/net/port-mirroring/Makefile +++ b/net/port-mirroring/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=port-mirroring PKG_VERSION:=1.4.4 -PKG_RELEASE:=2 +PKG_RELEASE:=3 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/020-time.patch b/net/port-mirroring/patches/020-time.patch new file mode 100644 index 000000000..224ed2738 --- /dev/null +++ b/net/port-mirroring/patches/020-time.patch @@ -0,0 +1,20 @@ +--- a/src/main.c ++++ b/src/main.c +@@ -252,7 +252,7 @@ void packet_handler_ex(const struct pcap_pkthdr* header, const u_char* pkt_data, + if (handle == NULL || pcap_sendpacket(handle, pkt_data, header->len) != 0) + { + //error detected +- long nowTime; ++ time_t nowTime; + time(&nowTime); + if (nowTime - cfg.init_time > ERRTIMEOUT && header->len < 1500) + { +@@ -282,7 +282,7 @@ void packet_handler_ex(const struct pcap_pkthdr* header, const u_char* pkt_data, + if (handle == NULL || pcap_sendpacket(handle, buf, header->len) != 0) + { + //error detected +- long nowTime; ++ time_t nowTime; + time(&nowTime); + if (nowTime - cfg.init_time > ERRTIMEOUT && header->len < 1500) + {