All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Grzegorz Nosek <blackfire@metal.art.pl>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: MARK target extension
Date: Sun, 06 Jun 2004 16:25:12 +0200	[thread overview]
Message-ID: <40C32948.2090809@trash.net> (raw)
In-Reply-To: <20040605205623.M81946@metal.art.pl>

Grzegorz Nosek wrote:

> I had a look at the patch and it's indeed similar but supports only
> single AND and OR operations and I think that it should allow more
> flexibility. If you don't like the idea of adding another parameter,
> maybe something like this would do:
> --set-mark overrides all, without further questions
> --and-mark and --or-mark are performed in sequence (thus more than one
> allowed), so that (in my proposed syntax)
>     --set-mark 0x1234 --mask 0xffff
> (leaving top 16 bits untouched) could be expressed as
>     --and-mark 0xffff0000 --or-mark 0x1234
> It shouldn't break any existing applications either (they're using
> only one of the parameters now).
> 
> It certainly is possible to get the same result using two consecutive
> rules but it seems inefficient.

I agree with you. CONNMARK seems to have the most flexible solution:
newmark = (ct->mark & ~markinfo->mask) | markinfo->mark;

Note that unlike with your patch, mark isn't ANDed with mask, so you can
also do a simple OR by setting mask to zero.

If you change your patch this way, and also make the userspace-part look
like CONNMARK (mark/mask instead of --mask), I'll happily replace the
MARK-operations patch.

Regards
Patrick

  reply	other threads:[~2004-06-06 14:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26 22:09 MARK target extension Grzegorz Nosek
2004-05-27  9:53 ` Patrick McHardy
2004-06-05 22:06   ` Grzegorz Nosek
2004-06-06 14:25     ` Patrick McHardy [this message]
     [not found]       ` <20040608073821.M38174@metal.art.pl>
2004-06-09  8:51         ` Patrick McHardy
2004-06-09 13:43           ` Henrik Nordstrom
2004-06-13 20:23             ` Patrick McHardy
2004-06-14 17:26               ` Grzegorz Nosek
2004-06-14 20:59                 ` Henrik Nordstrom
     [not found] <20040609222646.M64@metal.art.pl>
2004-06-10  9:59 ` Henrik Nordstrom

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=40C32948.2090809@trash.net \
    --to=kaber@trash.net \
    --cc=blackfire@metal.art.pl \
    --cc=netfilter-devel@lists.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.