Commit 58531931 authored by Anton Ivanov's avatar Anton Ivanov Committed by Richard Weinberger
Browse files

um: Add checks to mtu parameter parsing



Adds a sanity check to the parsing of mtu command line param

Signed-off-by: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 77f1073c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ static int get_mtu(struct arglist *def)

	if (mtu != NULL) {
		if (kstrtoul(mtu, 10, &result) == 0)
			if ((result < (1 << 16) - 1) && (result >= 576))
				return result;
	}
	return ETH_MAX_PACKET;