From 9d07ba2c775a9eab6f3ad2cd32dd413a6c190429 Mon Sep 17 00:00:00 2001 From: Rick Frankland Date: Tue, 30 Jun 2020 17:09:46 +0100 Subject: [PATCH] netcat: fix Illegal instruction on listen udp When listening to a udp port an Illegal instruction occurs. This did NOT happen when compiled with debug on. Fixes issue openwrt#4747, FS#2937 Signed-off-by: Rick Frankland --- net/netcat/Makefile | 2 +- net/netcat/patches/002-udp_listen_fix.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 net/netcat/patches/002-udp_listen_fix.patch diff --git a/net/netcat/Makefile b/net/netcat/Makefile index d36a0de1c..b595fe711 100644 --- a/net/netcat/Makefile +++ b/net/netcat/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netcat PKG_VERSION:=0.7.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/$(PKG_NAME) diff --git a/net/netcat/patches/002-udp_listen_fix.patch b/net/netcat/patches/002-udp_listen_fix.patch new file mode 100644 index 000000000..0282b389b --- /dev/null +++ b/net/netcat/patches/002-udp_listen_fix.patch @@ -0,0 +1,14 @@ +--- a/src/core.c ++++ b/src/core.c +@@ -273,9 +273,9 @@ static int core_udp_listen(nc_sock_t *nc + dup_socket.domain = ncsock->domain; + dup_socket.proto = ncsock->proto; + memcpy(&dup_socket.local_host.iaddrs[0], &local_addr.sin_addr, +- sizeof(local_addr)); ++ sizeof(local_addr.sin_addr)); + memcpy(&dup_socket.host.iaddrs[0], &rem_addr.sin_addr, +- sizeof(local_addr)); ++ sizeof(rem_addr.sin_addr)); + dup_socket.local_port.netnum = local_addr.sin_port; + dup_socket.local_port.num = ntohs(local_addr.sin_port); + dup_socket.port.netnum = rem_addr.sin_port;