Commit 7bb6d86a authored by Ben Hutchings's avatar Ben Hutchings Committed by Stefan Bader

ipv4: Fix error return value in fib_convert_metrics()

BugLink: https://bugs.launchpad.net/bugs/1784409

The validation code modified by commit 5b5e7a0d ("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: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 1382f77c
...@@ -980,7 +980,7 @@ fib_convert_metrics(struct fib_info *fi, const struct fib_config *cfg) ...@@ -980,7 +980,7 @@ fib_convert_metrics(struct fib_info *fi, const struct fib_config *cfg)
return -EINVAL; return -EINVAL;
} else { } else {
if (nla_len(nla) != sizeof(u32)) if (nla_len(nla) != sizeof(u32))
return false; return -EINVAL;
val = nla_get_u32(nla); val = nla_get_u32(nla);
} }
if (type == RTAX_ADVMSS && val > 65535 - 40) if (type == RTAX_ADVMSS && val > 65535 - 40)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment