Re: Socket stuck listening after incoming SABM with no listener

2018-12-15 Thread David Ranch



Hey Thomas,


Good find! This does look pretty similar. I'm running a fairly up-to-date Raspbian. uname 
-r reports "4.9.27-v7+".


Running new kernels is supposed to be a GOOD thing but unfortunately, 
there are kernel developers out there that are making changes to the 
AX.25 code.  They are  thinking they are helping keep the kernel modern
and other developers rubber-stamp approve the changes without *any* 
testing!  Compiling code is NOT testing! Gah!..


Sorry, it's not a good situation.



Hmm that's getting pretty old now isn't it. Good to know it's probably not my 
config at fault.


Yes.. 3.18 is quite old and EOL but the 3.16.x series is still 
maintained.  The older kernels in the Ubuntu 14.04 series, Debian 
Wheezy, etc. are known to work well, etc.  All depends on what distro

you're running.

Btw, I was going through some of my previous emails from the UroNode and 
linux-hams email lists and there is various evidence of
these kernel issues cropping up.  If it's possible on your system, try 
an old kernel or even an older distro and see if your issues go away.


--David
KI6ZHD


Re: Socket stuck listening after incoming SABM with no listener

2018-12-15 Thread David Ranch



Hello Thomas,

I think you're hitting a known AX.25 kernel bug.  What kernel version 
are you running?Below is an email thread with another HAMs that was 
seeing

something similar.  He came back with:

   Ubuntu 14.04 LTS with the older kernel. Works great.


A few of us have been trying to find some help to get a few known kernel 
bugs squashed but haven't had any luck.  As such, many people are having 
to stay on <= 3.18.x kernels.


--David
KI6ZHD



 Forwarded Message 

Hi David. More info!

Before I connect:

Active AX.25 sockets
Dest   Source Device  StateVr/VsSend-Q  Recv-Q
*  WA7FPV-10  ax0 LISTENING000/000  0   0

While the connection is active:

Active AX.25 sockets
Dest   Source Device  StateVr/VsSend-Q  Recv-Q
WA7FPV-0   WA7FPV-10  ax0 ESTABLISHED  000/002  21120
*  WA7FPV-10  ax0 LISTENING000/000  0   0

Now I've issued the disconnect from WA7FPV-0

Active AX.25 sockets
Dest   Source Device  StateVr/VsSend-Q  Recv-Q
WA7FPV-0   WA7FPV-10  ax0 DISC SENT001/003  0 0
*  WA7FPV-10  ax0 LISTENING000/000  0 0

Now WA7FPV-0 has reported a clean disconnect, and sent the -UA frame

Active AX.25 sockets
Dest   Source Device  StateVr/VsSend-Q  Recv-Q
WA7FPV-0   WA7FPV-10  ax0 LISTENING001/003  0 0
*  WA7FPV-10  ax0 LISTENING000/000  0 0

And we are stuck here.

Next I tried connecting to WA7FPV-10 again from WA7FPV-0. I observed 
that DireWolf is decoding the packets ok. I hit disconnect (which 
generates another -UA frame), and that is also decoded by DireWolf, but 
does not close that listening socket. It seems like we have lost our 
ability to communicate with that rogue socket and tell it to close. And 
that rogue socket is blocking further connections. I tried 'axctl 0 
WA7FPV-0 WA7FPV-10 kill' - no dice. The socket still shows up when I run 
netstat.


I can still connect to/from WA7FPV-15 <--> WA7FPV using 'call 0 WA7FPV'. 
This works fine - I can keyboard to my self :)  When I disconnect the 
socket closes like it should.


Connected:

Active AX.25 sockets
Dest   Source Device  StateVr/VsSend-Q  Recv-Q
WA7FPV-0   WA7FPV-15  ax0 ESTABLISHED  000/000  0 0
WA7FPV-0   WA7FPV-10  ax0 LISTENING001/003  0 0
*  WA7FPV-10  ax0 LISTENING000/000  0 0

Couldn't capture the 'disconnect' state as it happened too fast, but 
here is after the disconnect:


Active AX.25 sockets
Dest   Source Device  StateVr/VsSend-Q  Recv-Q
WA7FPV-0   WA7FPV-10  ax0 LISTENING001/003  0 0
*  WA7FPV-10  ax0 LISTENING000/000  0 0

So clearly the audio levels are good, AX.25 is working, DireWolf is 
working. I guess that leaves rmsgw. Or perhaps something about ax25d? 
This is my ax25d.conf


# /etc/ax25/ax25d.conf
[WA7FPV-10 via 0]
NOCALL * * * * * * L
default * * * * * *  -  rmsgw  /usr/local/bin/rmsgw rmsgw -l debug -P %d %U
# End /etc/ax25/ax25d.conf

Here is possibly useful info from /var/log/syslog

Mar 25 12:34:23 LinuxRMSGatewayBox kernel: [  402.289950] IPv6: 
ADDRCONF(NETDEV_CHANGE): ax0: link becomes ready
Mar 25 12:34:35 LinuxRMSGatewayBox dhclient: DHCPREQUEST of 
128.208.93.190 on eth0 to 140.142.5.93 port 67 (xid=0x2c5d9cce)
Mar 25 12:34:35 LinuxRMSGatewayBox dhclient: DHCPACK of 128.208.93.190 
from 140.142.5.93
Mar 25 12:34:35 LinuxRMSGatewayBox dhclient: bound to 128.208.93.190 -- 
renewal in 368550 seconds.
Mar 25 12:34:46 LinuxRMSGatewayBox kernel: [  425.323910] perf interrupt 
took too long (2532 > 2500), lowering kernel.perf_event_max_sample_rate 
to 5
Mar 25 12:35:48 LinuxRMSGatewayBox kernel: [  487.195348] mkiss: ax0: 
Trying crc-smack

Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: getopt saw '-l'
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]:  optarg = debug
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: getopt saw '-P'
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]:  optarg = 0
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: configfilearg = (null)
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: configfile = 
/etc/rmsgw/gateway.conf
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: using config file 
/etc/rmsgw/gateway.conf
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: using version file 
/etc/rmsgw/.version_info
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: #012WA7FPV-10 - Linux 
RMS Gateway 2.4.0 Mar 24 2016 (CN87us)#012
Mar 25 12:35:48 LinuxRMSGatewayBox kernel: [  487.346736] mkiss: ax0: 
Trying crc-flexnet
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: WARNING: setcmsstat() 
failed (errno = 13)
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: Channel: WA7FPV-10 on 0 
(14505 Hz, mode 0)
Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: Login WA7FPV on 0 
connected to sandiego.winlink.org 

Mar 25 12:35:48 LinuxRMSGatewayBox rmsgw[1490]: *** Secure Gateway Logon
Mar 25