* This might be encapsulated within another frame; we might be passed
* a pointer to a function that can print header information for that
* frame's protocol, and an argument to pass to that function.
+ *
+ * FIXME: caplen can and should be derived from ndo->ndo_snapend and p.
*/
u_int
ether_print(netdissect_options *ndo,
if (ethertype_print(ndo, prot, bp, len, len, NULL, NULL) == 0) {
if (prot == ETHERTYPE_TEB)
- ether_print(ndo, bp, len, len, NULL, NULL);
+ ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL);
else
ND_PRINT((ndo, "geneve-proto-0x%x", prot));
}
isoclns_print(ndo, bp, len, len);
break;
case ETHERTYPE_TEB:
- ether_print(ndo, bp, len, len, NULL, NULL);
+ ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL);
break;
default:
ND_PRINT((ndo, "gre-proto-0x%x", prot));
ip6_print(ndo, bp, next_len);
break;
case 0x3:
- ether_print(ndo, bp, next_len, next_len, NULL, NULL);
+ ether_print(ndo, bp, next_len, ndo->ndo_snapend - bp, NULL, NULL);
break;
default:
ND_PRINT((ndo, "ERROR: unknown-next-protocol"));
ND_TCHECK(*bp);
bp += 1;
- ether_print(ndo, bp, len - 8, len - 8, NULL, NULL);
+ ether_print(ndo, bp, len - 8, ndo->ndo_snapend - bp, NULL, NULL);
return;
trunc:
ip6_print(ndo, bp, len - 8);
break;
case 0x3:
- ether_print(ndo, bp, len - 8, len - 8, NULL, NULL);
+ ether_print(ndo, bp, len - 8, ndo->ndo_snapend - bp, NULL, NULL);
break;
case 0x4:
nsh_print(ndo, bp, len - 8);
ND_PRINT((ndo, "flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags));
ND_PRINT((ndo, "vni %u\n", vni));
- ether_print(ndo, bp, len - VXLAN_HDR_LEN, len - VXLAN_HDR_LEN, NULL, NULL);
+ ether_print(ndo, bp, len - VXLAN_HDR_LEN, ndo->ndo_snapend - bp, NULL, NULL);
return;
ipv6hdr-heapoverflow ipv6hdr-heapoverflow.pcap ipv6hdr-heapoverflow.out -t
ipv6hdr-heapoverflow-v ipv6hdr-heapoverflow.pcap ipv6hdr-heapoverflow-v.out -t -v
otv-heapoverflow-1 otv-heapoverflow-1.pcap otv-heapoverflow-1.out -t -c10
+otv-heapoverflow-2 otv-heapoverflow-2.pcap otv-heapoverflow-2.out -t -c10
# RTP tests
# fuzzed pcap
--- /dev/null
+IP 192.168.0.134.47808 > 192.168.0.24.47808: UDP, length 6
+IP 192.168.0.134.47808 > 192.168.0.24.47808: UDP, length 12
+IP 192.168.0.24.47808 > 192.168.0.134.47808: UDP, length 6
+IP 192.168.0.24.47808 > 192.168.0.255.47808: UDP, length 18
+IP 192.168.0.105.47808 > 192.168.0.255.47808: UDP, length 25
+IP 192.168.0.24.47808 > 192.168.0.134.47808: UDP, length 31
+IP 192.168.0.18.47808 > 192.168.0.255.47808: UDP, length 24
+IP 192.168.0.24.40896 > 192.168.0.134.47808: UDP, length 30
+IP 192.168.0.24.47808 > 192.168.0.255.47808: UDP, length 20
+IP 192.168.0.9.37123 > 97.34.1.224.8472: OTV, flags [I] (0x9d), overlay 12124160, instance 4587520
+[|ether]