improved debugging arrangements for packetradio.

This commit is contained in:
gardners 2013-02-15 07:12:01 +10:30 committed by Jeremy Lakeman
parent b79e8261d5
commit 4d674d06b9
2 changed files with 4 additions and 3 deletions

View File

@ -217,7 +217,8 @@ overlay_interface_read_any(struct sched_ent *alarm){
interface->name);
if (packetOkOverlay(interface, packet, plen, recvttl, &src_addr, addrlen)) {
WHY("Malformed packet");
WHYF("Malformed packet (length = %d)",plen);
if (config.debug.slip) dump("the malformed packet",packet,plen);
}
}
if (alarm->poll.revents & (POLLHUP | POLLERR)) {

4
slip.c
View File

@ -251,11 +251,11 @@ int slip_decode(struct slip_decode_state *state)
// Check that CRC matches
unsigned long crc=Crc32_ComputeBuf( 0, state->dst, state->packet_length);
if (crc!=state->crc) {
if (config.debug.slip)
if (config.debug.packetradio)
DEBUGF("Rejected packet of %d bytes due to CRC mis-match (%08x vs %08x)",
state->packet_length,crc,state->crc);
} else {
if (config.debug.slip)
if (config.debug.packetradio)
DEBUGF("Accepted packet of %d bytes (CRC ok)",state->packet_length);
return state->packet_length;
}