summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2018-06-19 20:47:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-11 17:26:42 +0300
commit58d7ac7d3078e64c787350985c76bdd14f2d3557 (patch)
tree90ffef0290d71685f3372629a7b7093e960ce4dc /net/ipv4
parente581746bc737ce8d72982359bf479f19d84bee09 (diff)
downloadlinux-58d7ac7d3078e64c787350985c76bdd14f2d3557.tar.xz
ipv4: Fix error return value in fib_convert_metrics()
The validation code modified by commit 5b5e7a0de2bb ("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>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fib_semantics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index d476b7950adf..a88dab33cdf6 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -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)