aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2022-06-08 13:22:25 +0000
committerrodri <rgl@antares-labs.eu>2022-06-08 13:22:25 +0000
commit0a15926abc589c372acf404765862bb22febd64d (patch)
treeaebb1fbf6b835305098727a7e8efb68ee24ee32e
parenta5c44d9c396b02c013c9d76709382d7e67aee458 (diff)
downloadmusw-0a15926abc589c372acf404765862bb22febd64d.tar.gz
musw-0a15926abc589c372acf404765862bb22febd64d.tar.bz2
musw-0a15926abc589c372acf404765862bb22febd64d.zip
show the ports on the debugging output when receiving.
-rw-r--r--muswd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/muswd.c b/muswd.c
index e6999b2..8e07272 100644
--- a/muswd.c
+++ b/muswd.c
@@ -17,6 +17,7 @@ threadlisten(void *arg)
{
uchar buf[1024], *p, *e;
int fd, n;
+ ushort rport, lport;
ulong kdown;
Ioproc *io;
Udphdr *udp;
@@ -32,9 +33,14 @@ threadlisten(void *arg)
p = buf+Udphdrsize;
e = buf+n;
+ rport = udp->rport[0]<<8 | udp->rport[1];
+ lport = udp->lport[0]<<8 | udp->lport[1];
+
unpack(p, e-p, "k", &kdown);
- fprint(2, "%I → %I | %d (%d) rcvd %.*lub\n",
- udp->raddr, udp->laddr, threadid(), getpid(), sizeof(kdown)*8, kdown);}
+ if(debug)
+ fprint(2, "%I!%d → %I!%d | %d (%d) rcvd %.*lub\n",
+ udp->raddr, rport, udp->laddr, lport, threadid(), getpid(), sizeof(kdown)*8, kdown);
+ }
closeioproc(io);
}