summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trafgen.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/trafgen.c b/trafgen.c
index 53320fe..93bb1b4 100644
--- a/trafgen.c
+++ b/trafgen.c
@@ -138,6 +138,8 @@ struct icmp_filter {
#define SMOKE_N_PROBES 100
+#define PKT_MIN_LEN 14
+
static void signal_handler(int number)
{
switch (number) {
@@ -791,10 +793,11 @@ static int xmit_packet_precheck(struct ctx *ctx, unsigned int cpu)
}
for (mtu = device_mtu(ctx->device), i = 0; i < plen; ++i) {
- if (packets[i].len > mtu + 14)
+ if (packets[i].len > mtu + PKT_MIN_LEN)
panic("Device MTU < than packet%d's size!\n", i);
- if (packets[i].len <= 14)
- panic("Packet%d's size too short!\n", i);
+ if (packets[i].len <= PKT_MIN_LEN)
+ panic("Packet%d's size must be > %d bytes!\n",
+ i, PKT_MIN_LEN);
}
return 0;