Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Cedric Blancher <blancher@cartel-securite.fr>
To: Peteris Krumins <newsgroups@lf.lv>
Cc: netfilter@lists.netfilter.org
Subject: Re: mark match
Date: 29 Mar 2003 15:40:28 +0100	[thread overview]
Message-ID: <1048948827.4792.18.camel@elendil.intranet.cartel-securite.net> (raw)
In-Reply-To: <190389138671.20030329152552@lf.lv>

Le sam 29/03/2003 à 14:25, Peteris Krumins a écrit :
>  for example, i want to match anything marked from 1 (1b) to
>  127 (1111111b), is it possible to do it using a mask?
> 
>  nfmark    mask    match
>  1      &  127  =  1
>  77     &  127  =  77

To be valuable, a mask has to have some low bits to 0. If all mask's
bits are set to 1, than it only matches the masked value... For your
purpose, you have to use 128 (10000000b) as mask :

	1    & 128 = 0
	77   & 128 = 0
	128  & 128 = 128
	129  & 128 = 128

So, you match 0, with a 128 mask, which may be, I guess, something like
"-m mark --mark 0/128".

Note that 0 will also match.

It is basicly the same system as netmasks.

-- 
Cédric Blancher  <blancher@cartel-securite.fr>
IT systems and networks security - Cartel Sécurité
Phone : +33 (0)1 44 06 97 87 - Fax: +33 (0)1 44 06 97 99
PGP KeyID:157E98EE  FingerPrint:FA62226DA9E72FA8AECAA240008B480E157E98EE


  reply	other threads:[~2003-03-29 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-29 13:25 mark match Peteris Krumins
2003-03-29 14:40 ` Cedric Blancher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-06-30 20:49 Gabriel Kujawski

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=1048948827.4792.18.camel@elendil.intranet.cartel-securite.net \
    --to=blancher@cartel-securite.fr \
    --cc=netfilter@lists.netfilter.org \
    --cc=newsgroups@lf.lv \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox