diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-11-05 22:54:05 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2015-11-05 22:54:05 +0100 |
commit | f91b1752029fffce868e3331a23c1c8ee741b372 (patch) | |
tree | 69068dbec80a5e315c576a5bbb5fdeed15ac93e5 /trafgen.c | |
parent | 652bcb10a32bb898c16f4ba16c07ad6a1cdfda74 (diff) |
trafgen: let the kernel check min/max transm. unit boundaries
Let AF_PACKET do this job to fail in case boundaries are too small or
too large. I found it quite useful for testing the kernel.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'trafgen.c')
-rw-r--r-- | trafgen.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -798,9 +798,9 @@ static void __set_state_cd(unsigned int cpu, unsigned long p, sig_atomic_t s) static void xmit_packet_precheck(struct ctx *ctx, unsigned int cpu) { - unsigned int i; unsigned long plen_total, orig = ctx->num; - size_t mtu, total_len = 0; + size_t total_len = 0; + unsigned int i; bug_on(plen != dlen); @@ -822,14 +822,6 @@ static void xmit_packet_precheck(struct ctx *ctx, unsigned int cpu) __set_state(cpu, CPU_STATS_STATE_RES); return; } - - for (mtu = device_mtu(ctx->device), i = 0; i < plen; ++i) { - if (packets[i].len > mtu + PKT_MIN_LEN) - panic("Device MTU < than packet%d's size!\n", i); - if (packets[i].len <= PKT_MIN_LEN) - panic("Packet%d's size must be > %d bytes!\n", - i, PKT_MIN_LEN); - } } static void main_loop(struct ctx *ctx, char *confname, bool slow, |