diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-02-27 18:50:20 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-02-27 18:53:37 -0800 |
commit | 812285fa5ab129e3a55682314bf235f701564310 (patch) | |
tree | c46fa77ecfc97e4120c02b7a8bd517e635afc7ee /net/sctp | |
parent | d7f10df86202273155a9d8f8553bc2ad28e0dd46 (diff) | |
parent | 085c20cacf2b72991ce1c9d99a5e2f1d9e73bb68 (diff) | |
download | linux-812285fa5ab129e3a55682314bf235f701564310.tar.bz2 |
Merge branch 'bpf_sk_storage_via_inet_diag'
Martin KaFai Lau says:
====================
The bpf_prog can store specific info to a sk by using bpf_sk_storage.
In other words, a sk can be extended by a bpf_prog.
This series is to support providing bpf_sk_storage data during inet_diag's
dump. The primary target is the usage like iproute2's "ss".
The first two patches are refactoring works in inet_diag to make
adding bpf_sk_storage support easier. The next two patches do
the actual work.
Please see individual patch for details.
v2:
- Add commit message for u16 to u32 change in min_dump_alloc in Patch 4 (Song)
- Add comment to explain the !skb->len check in __inet_diag_dump in Patch 4.
- Do the map->map_type check earlier in Patch 3 for readability.
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/diag.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sctp/diag.c b/net/sctp/diag.c index 8a15146faaeb..69743a6aaf6f 100644 --- a/net/sctp/diag.c +++ b/net/sctp/diag.c @@ -432,11 +432,12 @@ static void sctp_diag_get_info(struct sock *sk, struct inet_diag_msg *r, sctp_get_sctp_info(sk, infox->asoc, infox->sctpinfo); } -static int sctp_diag_dump_one(struct sk_buff *in_skb, - const struct nlmsghdr *nlh, +static int sctp_diag_dump_one(struct netlink_callback *cb, const struct inet_diag_req_v2 *req) { + struct sk_buff *in_skb = cb->skb; struct net *net = sock_net(in_skb->sk); + const struct nlmsghdr *nlh = cb->nlh; union sctp_addr laddr, paddr; struct sctp_comm_param commp = { .skb = in_skb, @@ -470,7 +471,7 @@ static int sctp_diag_dump_one(struct sk_buff *in_skb, } 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); |