mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-30 08:03:49 +00:00
add debug.rejecteddata option for reporting bad packets/manifests
etc.
This commit is contained in:
parent
6a620fe221
commit
042cfc3fa1
@ -201,6 +201,7 @@ ATOM(char, broadcasts, 0, cf_opt_char_boolean,, "")
|
||||
ATOM(char, packettx, 0, cf_opt_char_boolean,, "")
|
||||
ATOM(char, packetrx, 0, cf_opt_char_boolean,, "")
|
||||
ATOM(char, packetradio, 0, cf_opt_char_boolean,, "")
|
||||
ATOM(char, rejecteddata, 0, cf_opt_char_boolean,, "")
|
||||
ATOM(char, slip, 0, cf_opt_char_boolean,, "")
|
||||
ATOM(char, packetconstruction, 0, cf_opt_char_boolean,, "")
|
||||
ATOM(char, rhizome, 0, cf_opt_char_boolean,, "")
|
||||
|
5
slip.c
5
slip.c
@ -249,9 +249,12 @@ int slip_decode(struct slip_decode_state *state)
|
||||
// Check that CRC matches
|
||||
uint32_t crc=Crc32_ComputeBuf( 0, state->dst, state->packet_length);
|
||||
if (crc!=state->crc) {
|
||||
if (config.debug.packetradio)
|
||||
if (config.debug.packetradio||config.debug.rejecteddata)
|
||||
DEBUGF("Rejected packet of %d bytes due to CRC mis-match (%08x vs %08x)",
|
||||
state->packet_length,crc,state->crc);
|
||||
if (config.debug.rejecteddata) {
|
||||
dump("bad packet",state->dst,state->packet_length);
|
||||
}
|
||||
} else {
|
||||
if (config.debug.packetradio)
|
||||
DEBUGF("Accepted packet of %d bytes (CRC ok)",state->packet_length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user