]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tools: netmap: pkt-gen: check packet length against interface MTU
authorvmaffione <vmaffione@FreeBSD.org>
Sat, 8 Dec 2018 12:52:09 +0000 (12:52 +0000)
committervmaffione <vmaffione@FreeBSD.org>
Sat, 8 Dec 2018 12:52:09 +0000 (12:52 +0000)
commit43ef1e771229beef7e336750fc5ea7da6742f8f0
treed7f334c68131e5968cc6162481a6d900a81a8825
parent40107bb258a51a2a5d3eb40ed38a53ba1fef2f85
tools: netmap: pkt-gen: check packet length against interface MTU

Validate the value of the -l argument (packet length) against the MTU of the netmap port.
In case the netmap port does not refer to a physical interface (e.g. VALE port or pipe), then
the netmap buffer size is used as MTU.
This change also sets a better default value for the -M option, so that pkt-gen uses
the largest possible fragments in case of multi-slot packets.

Differential Revision: https://reviews.freebsd.org/D18436
tools/tools/netmap/pkt-gen.c