Skip to content

Commit

Permalink
gre: reject GUE and FOU in collect metadata mode
Browse files Browse the repository at this point in the history
The collect metadata mode does not support GUE nor FOU. This might be
implemented later; until then, we should reject such config.

I think this is okay to be changed. It's unlikely anyone has such
configuration (as it doesn't work anyway) and we may need a way to
distinguish whether it's supported or not by the kernel later.

For backwards compatibility with iproute2, it's not possible to just check
the attribute presence (iproute2 always includes the attribute), the actual
value has to be checked, too.

Fixes: 2e15ea3 ("ip_gre: Add support to collect tunnel metadata.")
Signed-off-by: Jiri Benc <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Jiri Benc authored and davem330 committed Apr 28, 2016
1 parent 47ff580 commit 946b636
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,11 @@ static int ipgre_tunnel_validate(struct nlattr *tb[], struct nlattr *data[])
if (flags & (GRE_VERSION|GRE_ROUTING))
return -EINVAL;

if (data[IFLA_GRE_COLLECT_METADATA] &&
data[IFLA_GRE_ENCAP_TYPE] &&
nla_get_u16(data[IFLA_GRE_ENCAP_TYPE]) != TUNNEL_ENCAP_NONE)
return -EINVAL;

return 0;
}

Expand Down

0 comments on commit 946b636

Please sign in to comment.