diff options
author | Martin KaFai Lau <kafai@fb.com> | 2020-02-26 00:04:15 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-02-28 03:50:19 +0100 |
commit | 0df6d32842b9a5f97a29ea90c8adc5cfac38341d (patch) | |
tree | d9b50a11f25fb4c0f30505eed7cffae73879862b /net/sctp | |
parent | inet_diag: Refactor inet_sk_diag_fill(), dump(), and dump_one() (diff) | |
download | linux-0df6d32842b9a5f97a29ea90c8adc5cfac38341d.tar.xz linux-0df6d32842b9a5f97a29ea90c8adc5cfac38341d.zip |
inet_diag: Move the INET_DIAG_REQ_BYTECODE nlattr to cb->data
The INET_DIAG_REQ_BYTECODE nlattr is currently re-found every time when
the "dump()" is re-started.
In a latter patch, it will also need to parse the new
INET_DIAG_REQ_SK_BPF_STORAGES nlattr to learn the map_fds. Thus, this
patch takes this chance to store the parsed nlattr in cb->data
during the "start" time of a dump.
By doing this, the "bc" argument also becomes unnecessary
and is removed. Also, the two copies of the INET_DIAG_REQ_BYTECODE
parsing-audit logic between compat/current version can be
consolidated to one.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200225230415.1975555-1-kafai@fb.com
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/diag.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/diag.c b/net/sctp/diag.c index bed6436cd0af..69743a6aaf6f 100644 --- a/net/sctp/diag.c +++ b/net/sctp/diag.c @@ -471,7 +471,7 @@ static int sctp_diag_dump_one(struct netlink_callback *cb, } static void sctp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, - const struct inet_diag_req_v2 *r, struct nlattr *bc) + const struct inet_diag_req_v2 *r) { u32 idiag_states = r->idiag_states; struct net *net = sock_net(skb->sk); |