summaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_frontend.c
diff options
context:
space:
mode:
authorDavid Ahern2017-05-21 18:12:03 +0200
committerDavid S. Miller2017-05-22 18:12:20 +0200
commitc3ab2b4ec8f7c0700bf10957171c479bf3dbca52 (patch)
tree414dc0cf41405e9ab3ca2b3ab97d3a999cbf885a /net/ipv4/fib_frontend.c
parentnet: ipv4: Plumb extack through route add functions (diff)
downloadkernel-qcow2-linux-c3ab2b4ec8f7c0700bf10957171c479bf3dbca52.tar.gz
kernel-qcow2-linux-c3ab2b4ec8f7c0700bf10957171c479bf3dbca52.tar.xz
kernel-qcow2-linux-c3ab2b4ec8f7c0700bf10957171c479bf3dbca52.zip
net: ipv4: Add extack messages for route add failures
Add messages for non-obvious errors (e.g, no need to add text for malloc failures or ENODEV failures). This mostly covers the annoying EINVAL errors Some message strings violate the 80-columns but searchable strings need to trump that rule. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r--net/ipv4/fib_frontend.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 511edff76c01..14d2f7bd7c76 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -656,6 +656,7 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,
cfg->fc_nlinfo.nl_net = net;
if (cfg->fc_type > RTN_MAX) {
+ NL_SET_ERR_MSG(extack, "Invalid route type");
err = -EINVAL;
goto errout;
}
@@ -726,6 +727,7 @@ static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh,
tb = fib_get_table(net, cfg.fc_table);
if (!tb) {
+ NL_SET_ERR_MSG(extack, "FIB table does not exist");
err = -ESRCH;
goto errout;
}