Browse Source

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 <rfrankla@yahoo.com>
lilik-openwrt-22.03
Rick Frankland 4 years ago
parent
commit
9d07ba2c77
2 changed files with 15 additions and 1 deletions
  1. +1
    -1
      net/netcat/Makefile
  2. +14
    -0
      net/netcat/patches/002-udp_listen_fix.patch

+ 1
- 1
net/netcat/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=netcat PKG_NAME:=netcat
PKG_VERSION:=0.7.1 PKG_VERSION:=0.7.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/$(PKG_NAME) PKG_SOURCE_URL:=@SF/$(PKG_NAME)


+ 14
- 0
net/netcat/patches/002-udp_listen_fix.patch View File

@ -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;

Loading…
Cancel
Save