mirror of
https://passt.top/passt
synced 2025-09-01 09:23:13 +02:00
conf: Be more precise about minimum MTUs
Currently we reject the -m option if given a value less than ETH_MIN_MTU (68). That define is derived from the kernel, but its name is misleading: it doesn't really have anything to do with Ethernet per se, but is rather the minimum payload any L2 link must be able to handle in order to carry IPv4. For IPv6, it's not sufficient: that requires an MTU of at least 1280. Newer kernels have better named constants IPV4_MIN_MTU and IPv6_MIN_MTU. Copy and use those constants instead, along with some more specific error messages. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
672d786de1
commit
1924e25f07
3 changed files with 22 additions and 9 deletions
6
util.h
6
util.h
|
@ -34,15 +34,9 @@
|
|||
#ifndef ETH_MAX_MTU
|
||||
#define ETH_MAX_MTU USHRT_MAX
|
||||
#endif
|
||||
#ifndef ETH_MIN_MTU
|
||||
#define ETH_MIN_MTU 68
|
||||
#endif
|
||||
#ifndef IP_MAX_MTU
|
||||
#define IP_MAX_MTU USHRT_MAX
|
||||
#endif
|
||||
#ifndef IPV6_MIN_MTU
|
||||
#define IPV6_MIN_MTU 1280
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue