summaryrefslogtreecommitdiff
path: root/include/net/pkt_cls.h
diff options
context:
space:
mode:
authorGuillaume Nault <gnault@redhat.com>2020-03-23 21:48:47 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-26 19:52:31 -0700
commite4a58ef3ce4e7bd20c22390b13799c8f1c498780 (patch)
tree3803b26a64ac0bf2c51803bc7aa4660c5284dc58 /include/net/pkt_cls.h
parent6a864730aef830fa6dc1cda001c2f4418e151759 (diff)
net: sched: refine extack messages in tcf_change_indev
Add an error message when device wasn't found. While there, also set the bad attribute's offset in extack. Signed-off-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/pkt_cls.h')
-rw-r--r--include/net/pkt_cls.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 1db8b27d4515..41902e10d503 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -502,12 +502,16 @@ tcf_change_indev(struct net *net, struct nlattr *indev_tlv,
struct net_device *dev;
if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ) {
- NL_SET_ERR_MSG(extack, "Interface name too long");
+ NL_SET_ERR_MSG_ATTR(extack, indev_tlv,
+ "Interface name too long");
return -EINVAL;
}
dev = __dev_get_by_name(net, indev);
- if (!dev)
+ if (!dev) {
+ NL_SET_ERR_MSG_ATTR(extack, indev_tlv,
+ "Network device not found");
return -ENODEV;
+ }
return dev->ifindex;
}