mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/hotplug: validate mtu read from xenstore against RFC 791 minimum
RFC 791 sets the minimum acceptable mtu to 68:
Every internet module must be able to forward a datagram of 68
octets without further fragmentation. This is because an internet
header may be up to 60 octets, and the minimum fragment is 8 octets.
In the Linux kernel source:
include/net/ip.h:#define IPV4_MIN_MTU 68 /* RFC 791 */
While there is no reason to expect a value <68 to be read from xenstore or
from the bridge make the value test require a number >= this minimum.
Signed-off-by: James Dingwall <james@dingwall.me.uk>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
This commit is contained in:
1 parent
26b1671a1c
commit
7d6c3308cb
1 file changed
+1
-1
@@ -167,7 +167,7 @@ set_mtu () {
|
||||
log debug "$bridge MTU is $mtu"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$mtu" ] && [ "$mtu" -gt 0 ]
|
||||
if [ -n "$mtu" ] && [ "$mtu" -ge 68 ]
|
||||
then
|
||||
log debug "setting $dev MTU to $mtu"
|
||||
ip link set dev ${dev} mtu ${mtu} || :
|
||||
|
||||