summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2015-11-05 22:54:05 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2015-11-05 22:54:05 +0100
commitf91b1752029fffce868e3331a23c1c8ee741b372 (patch)
tree69068dbec80a5e315c576a5bbb5fdeed15ac93e5
parent652bcb10a32bb898c16f4ba16c07ad6a1cdfda74 (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>
-rw-r--r--trafgen.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/trafgen.c b/trafgen.c
index 9ecde20..f88db18 100644
--- a/trafgen.c
+++ b/trafgen.c
@@ -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,