X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3b8ff4bf0d8f389e00c19d6c094bce2bbf00deca..94366a69b0ea80c2e85aa89f7b7f30d7f335bd76:/print-olsr.c diff --git a/print-olsr.c b/print-olsr.c index 2b85d67c..27e88721 100644 --- a/print-olsr.c +++ b/print-olsr.c @@ -328,6 +328,9 @@ olsr_print(netdissect_options *ndo, ndo->ndo_protocol = "olsr"; tptr = pptr; + nd_print_protocol_caps(ndo); + ND_PRINT("v%u", (is_ipv6) ? 6 : 4); + if (length < sizeof(struct olsr_common)) { goto trunc; } @@ -337,8 +340,7 @@ olsr_print(netdissect_options *ndo, ptr.common = (const struct olsr_common *)tptr; length = ND_MIN(length, GET_BE_U_2(ptr.common->packet_len)); - ND_PRINT("OLSRv%i, seq 0x%04x, length %u", - (is_ipv6 == 0) ? 4 : 6, + ND_PRINT(", seq 0x%04x, length %u", GET_BE_U_2(ptr.common->packet_seq), length); @@ -359,8 +361,7 @@ olsr_print(netdissect_options *ndo, } msgptr; int msg_len_valid = 0; - if (is_ipv6) - { + if (is_ipv6) { ND_TCHECK_LEN(tptr, sizeof(struct olsr_msg6)); msgptr.v6 = (const struct olsr_msg6 *) tptr; msg_type = GET_U_1(msgptr.v6->msg_type); @@ -389,9 +390,7 @@ olsr_print(netdissect_options *ndo, msg_tlen = msg_len - sizeof(struct olsr_msg6); msg_data = tptr + sizeof(struct olsr_msg6); - } - else /* (!is_ipv6) */ - { + } else { /* (!is_ipv6) */ ND_TCHECK_LEN(tptr, sizeof(struct olsr_msg4)); msgptr.v4 = (const struct olsr_msg4 *) tptr; msg_type = GET_U_1(msgptr.v4->msg_type); @@ -532,8 +531,7 @@ olsr_print(netdissect_options *ndo, } case OLSR_HNA_MSG: - if (is_ipv6) - { + if (is_ipv6) { int i = 0; ND_PRINT("\n\t Advertised networks (total %u)", @@ -553,9 +551,7 @@ olsr_print(netdissect_options *ndo, msg_data += sizeof(struct olsr_hna6); msg_tlen -= sizeof(struct olsr_hna6); } - } - else - { + } else { int col = 0; ND_PRINT("\n\t Advertised networks (total %u)",