mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
um: Add checks to mtu parameter parsing
Adds a sanity check to the parsing of mtu command line param Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
77f1073c2c
commit
5853193103
1 changed files with 2 additions and 1 deletions
|
@ -121,7 +121,8 @@ static int get_mtu(struct arglist *def)
|
||||||
|
|
||||||
if (mtu != NULL) {
|
if (mtu != NULL) {
|
||||||
if (kstrtoul(mtu, 10, &result) == 0)
|
if (kstrtoul(mtu, 10, &result) == 0)
|
||||||
return result;
|
if ((result < (1 << 16) - 1) && (result >= 576))
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
return ETH_MAX_PACKET;
|
return ETH_MAX_PACKET;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue