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>
This commit is contained in:
parent
3ae230aee2
commit
9d07ba2c77
2 changed files with 15 additions and 1 deletions
|
@ -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)
|
||||
|
|
14
net/netcat/patches/002-udp_listen_fix.patch
Normal file
14
net/netcat/patches/002-udp_listen_fix.patch
Normal 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…
Reference in a new issue