diff --git a/ethertype-dump.c b/ethertype-dump.c index 4499385..81aa195 100644 --- a/ethertype-dump.c +++ b/ethertype-dump.c @@ -82,6 +82,14 @@ int main(int argc, char **argv) { continue; } + if (frame_length > 1522) { + errno = 0; + if (printf("Overlong frame (%zdB)\n", frame_length) == -1) { + err(1, "printf"); + } + continue; + } + // Extract the MACs // 012345 012345 // dest source