From: Eric Leblond <eric@inl.fr>
To: netfilter-devel@lists.netfilter.org
Cc: pablo@netfilter.org
Subject: [PATCH] Set mark to 0 from libnetfilter_conntrack
Date: Wed, 25 Oct 2006 20:38:18 +0200 [thread overview]
Message-ID: <1161801498.12718.22.camel@localhost> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 519 bytes --]
Hi,
Damien Boucard from INL has discovered a bug in libnetfilter_conntrack :
Mark can not be set to 0.
After looking at the code I've found that we only change the mark if it
is not set to 0 :
if (ct->mark != 0)
nfnl_addattr_l(&req->nlh, sizeof(buf), CTA_MARK, &mark,
sizeof(u_int32_t));
What's the cleanest way to solve this. I don't see any mean to correct
this except adding an IPS_CHANGE_MARK flag.
Proposed patch is attached to the mail.
BR,
--
Eric Leblond <eric@inl.fr>
INL
[-- Attachment #1.2: enable_setting_mark_to_zero.patch --]
[-- Type: text/x-patch, Size: 1015 bytes --]
Index: include/libnetfilter_conntrack/libnetfilter_conntrack.h
===================================================================
--- include/libnetfilter_conntrack/libnetfilter_conntrack.h (revision 6689)
+++ include/libnetfilter_conntrack/libnetfilter_conntrack.h (working copy)
@@ -196,6 +196,10 @@
IPS_FIXED_TIMEOUT_BIT = 10,
IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
+ /* Connectio must change MARK */
+ IPS_CHANGE_MARK_BIT = 11,
+ IPS_CHANGE_MARK = (1 << IPS_FIXED_CHANGE_MARK),
+
};
enum {
Index: src/libnetfilter_conntrack.c
===================================================================
--- src/libnetfilter_conntrack.c (revision 6689)
+++ src/libnetfilter_conntrack.c (working copy)
@@ -976,7 +976,7 @@
nfnl_addattr_l(&req->nlh, sizeof(buf), CTA_TIMEOUT, &timeout,
sizeof(u_int32_t));
- if (ct->mark != 0)
+ if (ct->status & IPS_CHANGE_MARK)
nfnl_addattr_l(&req->nlh, sizeof(buf), CTA_MARK, &mark,
sizeof(u_int32_t));
[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next reply other threads:[~2006-10-25 18:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-25 18:38 Eric Leblond [this message]
2006-10-25 23:37 ` [PATCH] Set mark to 0 from libnetfilter_conntrack Patrick McHardy
2006-10-26 21:37 ` Eric Leblond
2006-10-27 13:53 ` Pablo Neira Ayuso
2006-10-27 21:17 ` Eric Leblond
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1161801498.12718.22.camel@localhost \
--to=eric@inl.fr \
--cc=netfilter-devel@lists.netfilter.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.