netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] lwtunnel: change to use nla_parse_nested on new options
@ 2019-11-10  4:16 Xin Long
  2019-11-11 12:40 ` Simon Horman
  2019-11-11 22:43 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Xin Long @ 2019-11-10  4:16 UTC (permalink / raw)
  To: network dev; +Cc: davem, David Ahern

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: b0a21810bd5e ("lwtunnel: add options setting and dumping for erspan")
Fixes: edf31cbb1502 ("lwtunnel: add options setting and dumping for vxlan")
Fixes: 4ece47787077 ("lwtunnel: add options setting and dumping for geneve")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/ipv4/ip_tunnel_core.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index d4f84bf..ee71e76 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -257,8 +257,8 @@ static int ip_tun_parse_opts_geneve(struct nlattr *attr,
 	struct nlattr *tb[LWTUNNEL_IP_OPT_GENEVE_MAX + 1];
 	int data_len, err;
 
-	err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPT_GENEVE_MAX,
-					  attr, geneve_opt_policy, extack);
+	err = nla_parse_nested(tb, LWTUNNEL_IP_OPT_GENEVE_MAX, attr,
+			       geneve_opt_policy, extack);
 	if (err)
 		return err;
 
@@ -294,8 +294,8 @@ static int ip_tun_parse_opts_vxlan(struct nlattr *attr,
 	struct nlattr *tb[LWTUNNEL_IP_OPT_VXLAN_MAX + 1];
 	int err;
 
-	err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPT_VXLAN_MAX,
-					  attr, vxlan_opt_policy, extack);
+	err = nla_parse_nested(tb, LWTUNNEL_IP_OPT_VXLAN_MAX, attr,
+			       vxlan_opt_policy, extack);
 	if (err)
 		return err;
 
@@ -320,8 +320,8 @@ static int ip_tun_parse_opts_erspan(struct nlattr *attr,
 	struct nlattr *tb[LWTUNNEL_IP_OPT_ERSPAN_MAX + 1];
 	int err;
 
-	err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPT_ERSPAN_MAX,
-					  attr, erspan_opt_policy, extack);
+	err = nla_parse_nested(tb, LWTUNNEL_IP_OPT_ERSPAN_MAX, attr,
+			       erspan_opt_policy, extack);
 	if (err)
 		return err;
 
@@ -362,8 +362,8 @@ static int ip_tun_parse_opts(struct nlattr *attr, struct ip_tunnel_info *info,
 	if (!attr)
 		return 0;
 
-	err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_OPTS_MAX, attr,
-					  ip_opts_policy, extack);
+	err = nla_parse_nested(tb, LWTUNNEL_IP_OPTS_MAX, attr,
+			       ip_opts_policy, extack);
 	if (err)
 		return err;
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] lwtunnel: change to use nla_parse_nested on new options
  2019-11-10  4:16 [PATCH net-next] lwtunnel: change to use nla_parse_nested on new options Xin Long
@ 2019-11-11 12:40 ` Simon Horman
  2019-11-11 22:43 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2019-11-11 12:40 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, davem, David Ahern

On Sun, Nov 10, 2019 at 12:16:22PM +0800, Xin Long wrote:
> 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: b0a21810bd5e ("lwtunnel: add options setting and dumping for erspan")
> Fixes: edf31cbb1502 ("lwtunnel: add options setting and dumping for vxlan")
> Fixes: 4ece47787077 ("lwtunnel: add options setting and dumping for geneve")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Reviewed-by: Simon Horman <simon.horman@netronome.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] lwtunnel: change to use nla_parse_nested on new options
  2019-11-10  4:16 [PATCH net-next] lwtunnel: change to use nla_parse_nested on new options Xin Long
  2019-11-11 12:40 ` Simon Horman
@ 2019-11-11 22:43 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-11-11 22:43 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, dsahern

From: Xin Long <lucien.xin@gmail.com>
Date: Sun, 10 Nov 2019 12:16:22 +0800

> 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: b0a21810bd5e ("lwtunnel: add options setting and dumping for erspan")
> Fixes: edf31cbb1502 ("lwtunnel: add options setting and dumping for vxlan")
> Fixes: 4ece47787077 ("lwtunnel: add options setting and dumping for geneve")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-12 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-10  4:16 [PATCH net-next] lwtunnel: change to use nla_parse_nested on new options Xin Long
2019-11-11 12:40 ` Simon Horman
2019-11-11 22:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).