summaryrefslogtreecommitdiff
path: root/include/uapi/linux/inet_diag.h
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2020-02-25 15:04:15 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-02-27 18:50:19 -0800
commit0df6d32842b9a5f97a29ea90c8adc5cfac38341d (patch)
treed9b50a11f25fb4c0f30505eed7cffae73879862b /include/uapi/linux/inet_diag.h
parent5682d393b40e1fe7426a7b8c3471f05262f42010 (diff)
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 'include/uapi/linux/inet_diag.h')
-rw-r--r--include/uapi/linux/inet_diag.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h
index a1ff345b3f33..bab9a9f8da12 100644
--- a/include/uapi/linux/inet_diag.h
+++ b/include/uapi/linux/inet_diag.h
@@ -64,9 +64,10 @@ struct inet_diag_req_raw {
enum {
INET_DIAG_REQ_NONE,
INET_DIAG_REQ_BYTECODE,
+ __INET_DIAG_REQ_MAX,
};
-#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
+#define INET_DIAG_REQ_MAX (__INET_DIAG_REQ_MAX - 1)
/* Bytecode is sequence of 4 byte commands followed by variable arguments.
* All the commands identified by "code" are conditional jumps forward: