diff options
-rw-r--r-- | print-calm-fast.c | 3 | ||||
-rw-r--r-- | print-geonet.c | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/print-calm-fast.c b/print-calm-fast.c index ba9776ca..9824072b 100644 --- a/print-calm-fast.c +++ b/print-calm-fast.c @@ -42,13 +42,12 @@ void calm_fast_print(netdissect_options *ndo, const u_char *eth, const u_char *bp, u_int length) { - printf("CALM FAST src:%s; ", etheraddr_string(eth+6)); - int srcNwref = bp[0]; int dstNwref = bp[1]; length -= 2; bp += 2; + printf("CALM FAST src:%s; ", etheraddr_string(eth+6)); printf("SrcNwref:%d; ", srcNwref); printf("DstNwref:%d; ", dstNwref); diff --git a/print-geonet.c b/print-geonet.c index 7cc06229..dd1d6bd7 100644 --- a/print-geonet.c +++ b/print-geonet.c @@ -58,14 +58,18 @@ static const struct tok msg_type_values[] = { static void print_btp_body(const u_char *bp, u_int length) { + int version; + int msg_type; + const char *msg_type_str; + if (length <= 2) { return; } // Assuming ItsDpuHeader - int version = bp[0]; - int msg_type = bp[1]; - const char *msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type); + version = bp[0]; + msg_type = bp[1]; + msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type); printf("; ItsPduHeader v:%d t:%d-%s", version, msg_type, msg_type_str); } |