mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
ipv4: Fix error return value in fib_convert_metrics()
The validation code modified by commit 5b5e7a0de2 ("net: metrics:
add proper netlink validation") is organised differently in older
kernel versions. The fib_convert_metrics() function that is modified
in the backports to 4.4 and 4.9 needs to returns an error code, not a
success flag.
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2aa465dbe2
commit
21e9341ed9
|
|
@ -980,7 +980,7 @@ fib_convert_metrics(struct fib_info *fi, const struct fib_config *cfg)
|
|||
return -EINVAL;
|
||||
} else {
|
||||
if (nla_len(nla) != sizeof(u32))
|
||||
return false;
|
||||
return -EINVAL;
|
||||
val = nla_get_u32(nla);
|
||||
}
|
||||
if (type == RTAX_ADVMSS && val > 65535 - 40)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user