From: dsahern@kernel.org
To: netdev@vger.kernel.org, davem@davemloft.net
Cc: christian@brauner.io, jbenc@redhat.com,
stephen@networkplumber.org, David Ahern <dsahern@gmail.com>
Subject: [PATCH RFC net-next 1/5] net/netlink: Pass extack to dump callbacks
Date: Fri, 28 Sep 2018 08:44:58 -0700 [thread overview]
Message-ID: <20180928154502.9983-2-dsahern@kernel.org> (raw)
In-Reply-To: <20180928154502.9983-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Pass extack to dump callbacks by adding extack to netlink_dump_control
and transferring to netlink_callback. Update rtnetlink as the first
user.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/linux/netlink.h | 2 ++
net/core/rtnetlink.c | 1 +
net/netlink/af_netlink.c | 1 +
3 files changed, 4 insertions(+)
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 71f121b66ca8..8fc90308a653 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -176,6 +176,7 @@ struct netlink_callback {
void *data;
/* the module that dump function belong to */
struct module *module;
+ struct netlink_ext_ack *extack;
u16 family;
u16 min_dump_alloc;
unsigned int prev_seq, seq;
@@ -197,6 +198,7 @@ struct netlink_dump_control {
int (*done)(struct netlink_callback *);
void *data;
struct module *module;
+ struct netlink_ext_ack *extack;
u16 min_dump_alloc;
};
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 35162e1b06ad..da91b38297d3 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -4689,6 +4689,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
.dump = dumpit,
.min_dump_alloc = min_dump_alloc,
.module = owner,
+ .extack = extack
};
err = netlink_dump_start(rtnl, skb, nlh, &c);
/* netlink_dump_start() will keep a reference on
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index e3a0538ec0be..7d9e735b32c4 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2307,6 +2307,7 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
cb->module = control->module;
cb->min_dump_alloc = control->min_dump_alloc;
cb->skb = skb;
+ cb->extack = control->extack;
if (control->start) {
ret = control->start(cb);
--
2.11.0
next prev parent reply other threads:[~2018-09-28 22:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 15:44 [PATCH RFC net-next 0/5] rtnetlink: Add support for rigid checking of data in dump request dsahern
2018-09-28 15:44 ` dsahern [this message]
2018-09-28 18:43 ` [PATCH RFC net-next 1/5] net/netlink: Pass extack to dump callbacks Christian Brauner
2018-09-28 15:44 ` [PATCH RFC net-next 2/5] net/ipv6: Refactor address dump to push inet6_fill_args to in6_dump_addrs dsahern
2018-09-28 18:44 ` Christian Brauner
2018-09-28 15:45 ` [PATCH RFC net-next 3/5] netlink: introduce NLM_F_DUMP_PROPER_HDR flag dsahern
2018-09-28 15:45 ` [PATCH RFC net-next 4/5] net/ipv4: Update inet_dump_ifaddr to support NLM_F_DUMP_PROPER_HDR dsahern
2018-09-28 18:41 ` Christian Brauner
2018-09-28 18:43 ` David Ahern
2018-09-28 15:45 ` [PATCH RFC net-next 5/5] net/ipv6: Update inet6_dump_addr " dsahern
2018-09-28 18:42 ` Christian Brauner
2018-09-28 18:45 ` [PATCH RFC net-next 0/5] rtnetlink: Add support for rigid checking of data in dump request Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180928154502.9983-2-dsahern@kernel.org \
--to=dsahern@kernel.org \
--cc=christian@brauner.io \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=jbenc@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.