Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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,
						      0, flags,
						      key_id, 0);
		} else {
			ret = -EINVAL;
			goto err_out;
		}

		if (!metadata) {
			ret = -EINVAL;
			ret = -ENOMEM;
			goto err_out;
		}