Files
kernel_arpi/include/uapi/linux
Romain Bellan cb8aa9a3af netfilter: ctnetlink: add kernel side filtering for dump
Conntrack dump does not support kernel side filtering (only get exists,
but it returns only one entry. And user has to give a full valid tuple)

It means that userspace has to implement filtering after receiving many
irrelevant entries, consuming resources (conntrack table is sometimes
very huge, much more than a routing table for example).

This patch adds filtering in kernel side. To achieve this goal, we:

 * Add a new CTA_FILTER netlink attributes, actually a flag list to
   parametize filtering
 * Convert some *nlattr_to_tuple() functions, to allow a partial parsing
   of CTA_TUPLE_ORIG and CTA_TUPLE_REPLY (so nf_conntrack_tuple it not
   fully set)

Filtering is now possible on:
 * IP SRC/DST values
 * Ports for TCP and UDP flows
 * IMCP(v6) codes types and IDs

Filtering is done as an "AND" operator. For example, when flags
PROTO_SRC_PORT, PROTO_NUM and IP_SRC are sets, only entries matching all
values are dumped.

Changes since v1:
  Set NLM_F_DUMP_FILTERED in nlm flags if entries are filtered

Changes since v2:
  Move several constants to nf_internals.h
  Move a fix on netlink values check in a separate patch
  Add a check on not-supported flags
  Return EOPNOTSUPP if CDA_FILTER is set in ctnetlink_flush_conntrack
  (not yet implemented)
  Code style issues

Changes since v3:
  Fix compilation warning reported by kbuild test robot

Changes since v4:
  Fix a regression introduced in v3 (returned EINVAL for valid netlink
  messages without CTA_MARK)

Changes since v5:
  Change definition of CTA_FILTER_F_ALL
  Fix a regression when CTA_TUPLE_ZONE is not set

Signed-off-by: Romain Bellan <romain.bellan@wifirst.fr>
Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2020-05-27 22:20:34 +02:00
..
2019-12-18 18:07:31 +01:00
2019-10-09 22:31:14 -04:00
2019-09-25 17:51:39 -07:00
2020-04-27 16:29:41 +05:30
2020-01-18 09:19:18 -05:00
2019-08-12 19:33:50 -07:00
2019-12-11 15:31:52 +01:00
2020-04-20 12:43:24 -07:00
2020-03-21 14:03:46 -06:00
2019-09-08 15:37:04 +02:00
2020-03-29 22:30:57 -07:00
2020-02-07 14:39:38 +09:00
2019-08-19 13:04:45 -07:00
2020-03-29 22:14:49 -07:00
2020-01-18 09:19:18 -05:00
2019-10-02 20:32:27 -06:00
2020-05-21 17:04:07 -07:00
2020-03-29 22:30:57 -07:00
2020-01-26 15:28:47 +01:00
2019-11-13 12:15:34 -08:00
2019-12-18 18:07:31 +01:00
2020-01-04 13:49:51 +08:00
2019-12-09 09:59:07 +01:00
2020-03-29 23:29:08 +02:00
2020-04-02 10:41:40 -04:00
2019-09-18 20:17:50 +02:00