From: Guy Harris Date: Thu, 29 Feb 2024 08:57:42 +0000 (-0800) Subject: ospf: pad TLVs in LS_OPAQUE_TYPE_RI to multiples of 4 bytes. X-Git-Tag: tcpdump-4.99.5~98 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/7cbe59ace63352092e37aee5e802d5b5254e0e24 ospf: pad TLVs in LS_OPAQUE_TYPE_RI to multiples of 4 bytes. Pick up fix from 6883ca65bed0b591fb611990ee8353182055b89d. --- diff --git a/print-ospf.c b/print-ospf.c index 7aa00d39..fd87e66d 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -844,6 +844,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; }