summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Osterried <ax25@x-berg.in-berlin.de>2016-03-14 10:18:49 +0100
committerThomas Osterried <ax25@x-berg.in-berlin.de>2016-03-14 10:18:49 +0100
commit39626d97b80152f8da5796d72971f55eb98dcb12 (patch)
treee35e6c4f21e0a919d37cbe98a3925fa079ee7535
parent73dcd18e9d692662837088fcfd80c5a632915326 (diff)
parenta0477a6737dd0012cadb88cebcc746d1c03c4fd0 (diff)
Merge branch 'master' of git://git.linux-ax25.org/pub/scm/ax25-apps
-rw-r--r--listen/listen.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/listen/listen.c b/listen/listen.c
index bf60281..ca933c6 100644
--- a/listen/listen.c
+++ b/listen/listen.c
@@ -188,6 +188,34 @@ int main(int argc, char **argv)
if (sock == -1 || sigint)
break;
if (ifr.ifr_hwaddr.sa_family == AF_AX25) {
+ if (size > 2 && *buffer == 0xcc) {
+ /* IP packets from the ax25 de-segmenter
+ are seen on socket "PF_PACKET,
+ SOCK_PACKET, ETH_P_ALL" without
+ AX.25 header (just the IP-frame),
+ prefixed by 0xcc (AX25_P_IP).
+ It's unclear why in the kernel code
+ this happens (unsegmentet AX25 PID
+ AX25_P_IP have not this behavior).
+ We have already displayed all the
+ segments and like to ignore this
+ data.
+ AX.25 packets start with a kiss
+ byte (buffer[0]); ax25_dump()
+ looks for it.
+ There's no kiss command 0xcc
+ defined; kiss bytes are checked
+ against & 0xf (= 0x0c), which is
+ also not defined.
+ Kiss commands may have one argument.
+ => We can make safely make the
+ assumption for first byte == 0xcc
+ and length > 2, that we safeley can
+ detect those IP frames, and then
+ ignore it.
+ */
+ continue;
+ }
display_port(sa.sa_data);
#ifdef NEW_AX25_STACK
ax25_dump(buffer, size, dumpstyle);