All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH conntrack 1/5] conntrack: support delete by label
@ 2016-01-25 11:15 Asbjørn Sloth Tønnesen
  2016-01-25 11:15 ` [PATCH conntrack 2/5] conntrack: consolidate filtering Asbjørn Sloth Tønnesen
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Asbjørn Sloth Tønnesen @ 2016-01-25 11:15 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: netfilter-devel, Asbjørn Sloth Tønnesen, Clemence Faure

This option was already silently allowed by 991fc4ae,
but didn't have any effect.

This patch adds the check and documents it.

Cc: Clemence Faure <clemence.faure@sophos.com>
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.dk>
---

Notes:
    I tried to create a test case, as well but I didn't
    seam to be able to get --label-add to work with
    create.

 conntrack.8     | 2 +-
 src/conntrack.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/conntrack.8 b/conntrack.8
index a981a76..970c2d7 100644
--- a/conntrack.8
+++ b/conntrack.8
@@ -146,7 +146,7 @@ In "\-\-create" mode, the mask is ignored.
 .TP
 .BI "-l, --label " "LABEL"
 Specify a conntrack label.
-This option is only available in conjunction with "\-L, \-\-dump", "\-E, \-\-event", or "\-U \-\-update".
+This option is only available in conjunction with "\-L, \-\-dump", "\-E, \-\-event", "\-U \-\-update" or "\-D \-\-delete".
 Match entries whose labels match at least those specified.
 Use multiple \-l commands to specify multiple labels that need to be set.
 Match entries whose labels matches at least those specified as arguments.
diff --git a/src/conntrack.c b/src/conntrack.c
index 45b8822..b5a0a13 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -1355,6 +1355,9 @@ static int delete_cb(enum nf_conntrack_msg_type type,
 	if (filter_mark(ct))
 		return NFCT_CB_CONTINUE;
 
+	if (filter_label(ct))
+		return NFCT_CB_CONTINUE;
+
 	if (options & CT_COMPARISON &&
 	    !nfct_cmp(obj, ct, NFCT_CMP_ALL | NFCT_CMP_MASK))
 		return NFCT_CB_CONTINUE;
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-02-16 18:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 11:15 [PATCH conntrack 1/5] conntrack: support delete by label Asbjørn Sloth Tønnesen
2016-01-25 11:15 ` [PATCH conntrack 2/5] conntrack: consolidate filtering Asbjørn Sloth Tønnesen
2016-02-01 11:02   ` Pablo Neira Ayuso
2016-01-25 11:15 ` [PATCH conntrack 3/5] conntrack: cleanup: use switch statements for family checks Asbjørn Sloth Tønnesen
2016-02-01 11:02   ` Pablo Neira Ayuso
2016-01-25 11:15 ` [PATCH conntrack 4/5 v2] conntrack: add support for netmask filtering Asbjørn Sloth Tønnesen
2016-02-01 11:04   ` Pablo Neira Ayuso
2016-02-01 12:17     ` Asbjørn Sloth Tønnesen
2016-02-01 17:56       ` Pablo Neira Ayuso
2016-02-02 15:55         ` Asbjørn Sloth Tønnesen
2016-02-02 16:34           ` Pablo Neira Ayuso
2016-02-16 18:18   ` Pablo Neira Ayuso
2016-01-25 11:15 ` [PATCH conntrack 5/5 v2] tests: conntrack: add netmask tests Asbjørn Sloth Tønnesen
2016-02-16 18:18   ` Pablo Neira Ayuso
2016-02-01 11:02 ` [PATCH conntrack 1/5] conntrack: support delete by label Pablo Neira Ayuso
2016-02-01 11:20   ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.