diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:52:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:52:31 +0000 |
commit | 31cd589d20ba8d3d6b3fc4fccacc40d38a163c5d (patch) | |
tree | 99d6c086833d530e5d1d33a8128961f8149843f0 /print-ospf.c | |
parent | Adding upstream version 4.99.4. (diff) | |
download | tcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.tar.xz tcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.zip |
Adding upstream version 4.99.5.upstream/4.99.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'print-ospf.c')
-rw-r--r-- | print-ospf.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/print-ospf.c b/print-ospf.c index e6bebed..eae546d 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 <config.h> -#endif #include "netdissect-stdinc.h" @@ -844,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; } @@ -1067,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; |