netcat failing

Eyal
 
Posts: 13
Joined: Wed Dec 28, 2016 7:42 am

netcat failing

Thu Aug 27, 2020 8:03 am

I flashed the latest firmware on my VoCore2.
Code: Select all
20200812.19073.bin


Runs OK. I have a few devices that need to post simple messages to it. I use UDP. To test it I first fired a Linux laptop and connected to the VoCore (wireless).
Looks OK, ping is good.

I now start this on the vc
Code: Select all
# netcat -l -n -u -p 21883 -v -v
Listening on any address 21883

So far so good. I now do this from a client (Linux):
Code: Select all
$ nc -u 192.168.3.60 21883
aaa

And now the vc says:
Code: Select all
Received packet from 192.168.3.247:55760 -> 192.168.3.60:21883 (local)
Trace/breakpoint trap

Then aborts. This is reproducible. Stopping the firewall has no effect.

strace does not help me, it ends with
Code: Select all
_newselect(4, [3], NULL, NULL, NULL)    = 1 (in [3])
recvmsg(3, {msg_name={sa_family=AF_INET, sin_port=htons(40405), sin_addr=inet_addr("192.168.3.247")}
, msg_namelen=16, msg_iov=[{iov_base="aaa\n", iov_len=1024}], msg_iovlen=1, msg_control=[{cmsg_len=2
4, cmsg_level=SOL_IP, cmsg_type=IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex("br-lan"), ipi_spe
c_dst=inet_addr("192.168.3.60"), ipi_addr=inet_addr("192.168.3.60")}}], msg_controllen=24, msg_flags
=0}, MSG_PEEK) = 4
writev(2, [{iov_base="Received packet from 192.168.3.2"..., iov_len=71}, {iov_base=NULL, iov_len=0}]
, 2Received packet from 192.168.3.247:40405 -> 192.168.3.60:21883 (local)
) = 71
--- SIGTRAP {si_signo=SIGTRAP, si_code=TRAP_BRKPT} ---
+++ killed by SIGTRAP +++


Is this a netcat issue? OpenWRT issue? vocore fw issue? Can someone please try this simple test.

TIA

Vonger
 
Posts: 821
Joined: Sun Oct 19, 2014 6:00 am

Re: netcat failing

Fri Aug 28, 2020 7:47 am

I tried "nc 192.168.61.231 12345" on vocore and "nc -l 12345" on my computer, it works well.
It should be that netcat issue.

Eyal
 
Posts: 13
Joined: Wed Dec 28, 2016 7:42 am

Re: netcat failing

Fri Aug 28, 2020 10:09 am

Thanks Vonger,

Just to be sure, you are using the same fw? I assume you do.

I do not see the '-u' option (udp) which I do use. TCP mode works for me too.
Can you please try udp mode?

Thanks

Vonger
 
Posts: 821
Joined: Sun Oct 19, 2014 6:00 am

Re: netcat failing

Thu Sep 03, 2020 12:06 am

my firmware do not support that option -u, if you want that i think it is able to enable at menuconfig busybox.

Eyal
 
Posts: 13
Joined: Wed Dec 28, 2016 7:42 am

Re: netcat failing [solved]

Thu Sep 03, 2020 7:00 am

Thanks again.

I also run your fw, 20200812.19073.bin. You say that you do not have a vocore2 with this image? I hoped you do.

Anyway, the opkg 'nc' does support udp. I had a look at the source repository
Code: Select all
https://github.com/openwrt/packages/tree/master/net/netcat


and I see a recent patch
Code: Select all
netcat: fix Illegal instruction on listen udp

so the problem is real. I now need to learn how to re-build this package,

However, I see there is an alternative, 'ncat'. This one works so my problem is solved.

Regards

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 4 guests