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
64enum {64enum {
65 INET_DIAG_REQ_NONE,65 INET_DIAG_REQ_NONE,
66 INET_DIAG_REQ_BYTECODE,66 INET_DIAG_REQ_BYTECODE,
67 __INET_DIAG_REQ_MAX,
67};68};
68 69
69#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE70#define INET_DIAG_REQ_MAX (__INET_DIAG_REQ_MAX - 1)
70 71
71/* Bytecode is sequence of 4 byte commands followed by variable arguments.72/* Bytecode is sequence of 4 byte commands followed by variable arguments.
72 * All the commands identified by "code" are conditional jumps forward:73 * All the commands identified by "code" are conditional jumps forward: