Merge pull request #11697 from neheb/port

port-mirroring: fix compilation under newer musl
This commit is contained in:
Rosen Penev 2020-04-02 16:13:30 -07:00 committed by GitHub
commit 5b2d270fef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=port-mirroring PKG_NAME:=port-mirroring
PKG_VERSION:=1.4.4 PKG_VERSION:=1.4.4
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/mmaraya/port-mirroring/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/mmaraya/port-mirroring/tar.gz/v$(PKG_VERSION)?

View file

@ -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)
{