ifname_subobj = (const struct icmp_interface_identification_ifname_subobject_t *) offset;
inft_name_length_field = GET_U_1(ifname_subobj->length);
- ND_PRINT("\n\t\t Interface Name, length %u: %.*s",
- inft_name_length_field,
- inft_name_length_field,
+ ND_PRINT("\n\t\t Interface Name");
+ if (inft_name_length_field % 4 != 0) {
+ ND_PRINT(" [length %u != N x 4]", inft_name_length_field);
+ nd_print_invalid(ndo);
+ offset += inft_name_length_field;
+ break;
+ }
+ if (inft_name_length_field > 64) {
+ ND_PRINT(" [length %u > 64]", inft_name_length_field);
+ nd_print_invalid(ndo);
+ offset += inft_name_length_field;
+ break;
+ }
+ ND_PRINT(", length %u", inft_name_length_field);
+ ND_PRINT(": %.*s", inft_name_length_field - 1,
ifname_subobj->if_name);
- offset += 1 + inft_name_length_field;
+ offset += inft_name_length_field;
}
if (mtu_flag) {
ND_PRINT("\n\t\t MTU: %u", GET_BE_U_4(offset));
This object describes the IP interface upon which a datagram arrived
Interface Index: 15
IP Address sub-object: 10.10.10.10
- Interface Name, length 63: This-is-the-name-of-the-Interface-that-we-are-looking-for-[:-)] [|icmp]
+ Interface Name [length 63 != N x 4] (invalid) [|icmp]
10.4.0.2 > 12.4.4.4: ICMP time exceeded in-transit, length 220
IP (tos 0x0, ttl 1, id 42321, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33440: UDP, length 12
- ICMP Multi-Part extension v2, checksum 0x256c (correct), length 84
+ ICMP Multi-Part extension v2, checksum 0x246c (correct), length 84
Interface Identification Object (2), Class-Type: 14, length 80
This object describes the IP interface upon which a datagram arrived
Interface Index: 15
IP Address sub-object: 10.10.10.10
- Interface Name, length 63: This-is-the-name-of-the-Interface-that-we-are-looking-for-[:-)]
+ Interface Name, length 64: This-is-the-name-of-the-Interface-that-we-are-looking-for-[:-)]