diff options
author | rodri <rgl@antares-labs.eu> | 2022-06-08 13:22:25 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2022-06-08 13:22:25 +0000 |
commit | 0a15926abc589c372acf404765862bb22febd64d (patch) | |
tree | aebb1fbf6b835305098727a7e8efb68ee24ee32e | |
parent | a5c44d9c396b02c013c9d76709382d7e67aee458 (diff) | |
download | musw-0a15926abc589c372acf404765862bb22febd64d.tar.gz musw-0a15926abc589c372acf404765862bb22febd64d.tar.bz2 musw-0a15926abc589c372acf404765862bb22febd64d.zip |
show the ports on the debugging output when receiving.
-rw-r--r-- | muswd.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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); } |