aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/uapi/linux/inet_diag.h
diff options
context:
space:
mode:
authorKristian Evensen <kristian.evensen@gmail.com>2017-12-27 18:27:58 +0100
committerDavid S. Miller <davem@davemloft.net>2018-01-02 13:54:04 -0500
commitbbb6189df4077cde8592cd2f804bb1122067dd32 (patch)
tree4f7f2ab154619d45f2bdbab77bd08867fb092411 /include/uapi/linux/inet_diag.h
parentMerge branch 's390-next' (diff)
downloadwireguard-linux-bbb6189df4077cde8592cd2f804bb1122067dd32.tar.xz
wireguard-linux-bbb6189df4077cde8592cd2f804bb1122067dd32.zip
inet_diag: Add equal-operator for ports
inet_diag currently provides less/greater than or equal operators for comparing ports when filtering sockets. An equal comparison can be performed by combining the two existing operators, or a user can for example request a port range and then do the final filtering in userspace. However, these approaches both have drawbacks. Implementing equal using LE/GE causes the size and complexity of a filter to grow quickly as the number of ports increase, while it on busy machines would be great if the kernel only returns information about relevant sockets. This patch introduces source and destination port equal operators. INET_DIAG_BC_S_EQ is used to match a source port, INET_DIAG_BC_D_EQ a destination port, and usage is the same as for the existing port operators. I.e., the port to match is stored in the no-member of the next inet_diag_bc_op-struct in the filter. Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/inet_diag.h')
-rw-r--r--include/uapi/linux/inet_diag.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h
index 817d807e9481..14565d703291 100644
--- a/include/uapi/linux/inet_diag.h
+++ b/include/uapi/linux/inet_diag.h
@@ -92,6 +92,8 @@ enum {
INET_DIAG_BC_D_COND,
INET_DIAG_BC_DEV_COND, /* u32 ifindex */
INET_DIAG_BC_MARK_COND,
+ INET_DIAG_BC_S_EQ,
+ INET_DIAG_BC_D_EQ,
};
struct inet_diag_hostcond {