Commit ed02551f authored by Xin Long's avatar Xin Long Committed by David S. Miller

lwtunnel: change to use nla_parse_nested on new options

As the new options added in kernel, all should always use strict
parsing from the beginning with nla_parse_nested(), instead of
nla_parse_nested_deprecated().

Fixes: b0a21810 ("lwtunnel: add options setting and dumping for erspan")
Fixes: edf31cbb ("lwtunnel: add options setting and dumping for vxlan")
Fixes: 4ece4778 ("lwtunnel: add options setting and dumping for geneve")
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe2b8a88
...@@ -257,8 +257,8 @@ static int ip_tun_parse_opts_geneve(struct nlattr *attr, ...@@ -257,8 +257,8 @@ static int ip_tun_parse_opts_geneve(struct nlattr *attr,
struct nlattr *tb[LWTUNNEL_IP_OPT_GENEVE_MAX + 1]; struct nlattr *tb[LWTUNNEL_IP_OPT_GENEVE_MAX + 1];
int data_len, err; int data_len, err;
err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPT_GENEVE_MAX, err = nla_parse_nested(tb, LWTUNNEL_IP_OPT_GENEVE_MAX, attr,
attr, geneve_opt_policy, extack); geneve_opt_policy, extack);
if (err) if (err)
return err; return err;
...@@ -294,8 +294,8 @@ static int ip_tun_parse_opts_vxlan(struct nlattr *attr, ...@@ -294,8 +294,8 @@ static int ip_tun_parse_opts_vxlan(struct nlattr *attr,
struct nlattr *tb[LWTUNNEL_IP_OPT_VXLAN_MAX + 1]; struct nlattr *tb[LWTUNNEL_IP_OPT_VXLAN_MAX + 1];
int err; int err;
err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPT_VXLAN_MAX, err = nla_parse_nested(tb, LWTUNNEL_IP_OPT_VXLAN_MAX, attr,
attr, vxlan_opt_policy, extack); vxlan_opt_policy, extack);
if (err) if (err)
return err; return err;
...@@ -320,8 +320,8 @@ static int ip_tun_parse_opts_erspan(struct nlattr *attr, ...@@ -320,8 +320,8 @@ static int ip_tun_parse_opts_erspan(struct nlattr *attr,
struct nlattr *tb[LWTUNNEL_IP_OPT_ERSPAN_MAX + 1]; struct nlattr *tb[LWTUNNEL_IP_OPT_ERSPAN_MAX + 1];
int err; int err;
err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPT_ERSPAN_MAX, err = nla_parse_nested(tb, LWTUNNEL_IP_OPT_ERSPAN_MAX, attr,
attr, erspan_opt_policy, extack); erspan_opt_policy, extack);
if (err) if (err)
return err; return err;
...@@ -362,7 +362,7 @@ static int ip_tun_parse_opts(struct nlattr *attr, struct ip_tunnel_info *info, ...@@ -362,7 +362,7 @@ static int ip_tun_parse_opts(struct nlattr *attr, struct ip_tunnel_info *info,
if (!attr) if (!attr)
return 0; return 0;
err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPTS_MAX, attr, err = nla_parse_nested(tb, LWTUNNEL_IP_OPTS_MAX, attr,
ip_opts_policy, extack); ip_opts_policy, extack);
if (err) if (err)
return err; return err;
......
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