diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2016-08-24 15:46:26 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-24 21:57:20 -0700 |
commit | a52e95abf772b43c9226e9a72d3c1353903ba96f (patch) | |
tree | 92e3d29500ba58f2069f70a064d224f299a4a4b0 /include | |
parent | 627cc4add53c0470bfd118002669205d222d3a54 (diff) | |
download | lwn-a52e95abf772b43c9226e9a72d3c1353903ba96f.tar.gz lwn-a52e95abf772b43c9226e9a72d3c1353903ba96f.zip |
net: diag: allow socket bytecode filters to match socket marks
This allows a privileged process to filter by socket mark when
dumping sockets via INET_DIAG_BY_FAMILY. This is useful on
systems that use mark-based routing such as Android.
The ability to filter socket marks requires CAP_NET_ADMIN, which
is consistent with other privileged operations allowed by the
SOCK_DIAG interface such as the ability to destroy sockets and
the ability to inspect BPF filters attached to packet sockets.
Tested: https://android-review.googlesource.com/261350
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/inet_diag.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h index abbd1dc5d683..5581206a08ae 100644 --- a/include/uapi/linux/inet_diag.h +++ b/include/uapi/linux/inet_diag.h @@ -73,6 +73,7 @@ enum { INET_DIAG_BC_S_COND, INET_DIAG_BC_D_COND, INET_DIAG_BC_DEV_COND, /* u32 ifindex */ + INET_DIAG_BC_MARK_COND, }; struct inet_diag_hostcond { @@ -82,6 +83,11 @@ struct inet_diag_hostcond { __be32 addr[0]; }; +struct inet_diag_markcond { + __u32 mark; + __u32 mask; +}; + /* Base info structure. It contains socket identity (addrs/ports/cookie) * and, alas, the information shown by netstat. */ struct inet_diag_msg { |