All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] netlink: Return extack message if attribute validation fails
@ 2018-06-26 19:39 dsahern
  2018-06-28  7:18 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: dsahern @ 2018-06-26 19:39 UTC (permalink / raw)
  To: netdev; +Cc: jakub.kicinski, David Ahern

From: David Ahern <dsahern@gmail.com>

Have one extack message for parsing and validating.

Signed-off-by: David Ahern <dsahern@gmail.com>
---
 lib/nlattr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/nlattr.c b/lib/nlattr.c
index dfa55c873c13..e335bcafa9e4 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -253,8 +253,8 @@ int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
 			if (policy) {
 				err = validate_nla(nla, maxtype, policy);
 				if (err < 0) {
-					if (extack)
-						extack->bad_attr = nla;
+					NL_SET_ERR_MSG_ATTR(extack, nla,
+							    "Attribute failed policy validation");
 					goto errout;
 				}
 			}
-- 
2.11.0

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

* Re: [PATCH net-next] netlink: Return extack message if attribute validation fails
  2018-06-26 19:39 [PATCH net-next] netlink: Return extack message if attribute validation fails dsahern
@ 2018-06-28  7:18 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-06-28  7:18 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, jakub.kicinski, dsahern

From: dsahern@kernel.org
Date: Tue, 26 Jun 2018 12:39:18 -0700

> From: David Ahern <dsahern@gmail.com>
> 
> Have one extack message for parsing and validating.
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>

Applied.

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

end of thread, other threads:[~2018-06-28  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-26 19:39 [PATCH net-next] netlink: Return extack message if attribute validation fails dsahern
2018-06-28  7:18 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.