Commit a1165b59 authored by Simon Horman's avatar Simon Horman Committed by David S. Miller

net/sched: act_tunnel_key: disambiguate metadata dst error cases

Metadata may be NULL for one of two reasons:
* Missing user input
* Failure to allocate the metadata dst

Disambiguate these case by returning -EINVAL for the former and -ENOMEM
for the latter rather than -EINVAL for both cases.

This is in preparation for using extended ack to provide more information
to users when parsing their input.
Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c90d1604
...@@ -143,10 +143,13 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla, ...@@ -143,10 +143,13 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
metadata = __ipv6_tun_set_dst(&saddr, &daddr, 0, 0, dst_port, metadata = __ipv6_tun_set_dst(&saddr, &daddr, 0, 0, dst_port,
0, flags, 0, flags,
key_id, 0); key_id, 0);
} else {
ret = -EINVAL;
goto err_out;
} }
if (!metadata) { if (!metadata) {
ret = -EINVAL; ret = -ENOMEM;
goto err_out; goto err_out;
} }
......
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