]> The Tcpdump Group git mirrors - tcpdump/commitdiff
ospf: pad TLVs in LS_OPAQUE_TYPE_RI to multiples of 4 bytes.
authorGuy Harris <[email protected]>
Thu, 29 Feb 2024 08:57:42 +0000 (00:57 -0800)
committerGuy Harris <[email protected]>
Thu, 29 Feb 2024 08:57:42 +0000 (00:57 -0800)
Pick up fix from 6883ca65bed0b591fb611990ee8353182055b89d.

print-ospf.c

index 7aa00d397a7b3ea86770938bcdc26058c18dd982..fd87e66d3d49d3d72dae6e6e4d65dc2874d5e983 100644 (file)
@@ -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;
                 }