X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/6bd9a10412ade1f1b5f4437a1427601155649344..0023eaa78f123676bfa9c5fba72ea4b8a59aaa70:/print-ospf.c diff --git a/print-ospf.c b/print-ospf.c index 9fe9123c..eae546d9 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -23,9 +23,7 @@ /* \summary: Open Shortest Path First (OSPF) printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -59,9 +57,10 @@ static const struct tok ospf_authtype_values[] = { static const struct tok ospf_rla_flag_values[] = { { RLA_FLAG_B, "ABR" }, { RLA_FLAG_E, "ASBR" }, - { RLA_FLAG_W1, "Virtual" }, - { RLA_FLAG_W2, "W2" }, + { RLA_FLAG_V, "Virtual" }, + { RLA_FLAG_W, "Wildcard" }, { RLA_FLAG_NT, "Nt" }, + { RLA_FLAG_H, "Host" }, { 0, NULL } }; @@ -843,6 +842,11 @@ ospf_print_lsa(netdissect_options *ndo, break; } + + /* in OSPF everything has to be 32-bit aligned, including TLVs */ + if (tlv_length % 4) { + tlv_length += (4 - (tlv_length % 4)); + } tptr+=tlv_length; ls_length_remaining-=tlv_length; } @@ -1066,7 +1070,8 @@ ospf_decode_v2(netdissect_options *ndo, case OSPF_TYPE_LS_ACK: lshp = op->ospf_lsa.lsa_lshdr; - while (ospf_print_lshdr(ndo, lshp) != -1) { + while ((const u_char *)lshp < dataend) { + ospf_print_lshdr(ndo, lshp); ++lshp; } break;