History

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.

Martin KaFai Lau committed 6 years ago

Commit 0df6d321 parent 5682d398 files · +98 −64Browse files

Showing the changes to include/uapi/linux (1 of 8 files). Show all

Unified · Split

include/uapi/linux/inet_diag.h+2−1
@@ -64,9 +64,10 @@ struct inet_diag_req_raw { · 63 unmodified lines
6464 enum {
6565 INET_DIAG_REQ_NONE,
6666 INET_DIAG_REQ_BYTECODE,
67+ __INET_DIAG_REQ_MAX,
6768 };
6869
69−#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
70+#define INET_DIAG_REQ_MAX (__INET_DIAG_REQ_MAX - 1)
7071
7172 /* Bytecode is sequence of 4 byte commands followed by variable arguments.
7273 * All the commands identified by "code" are conditional jumps forward: