netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: basteon <basteon@gmail.com>
To: netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org
Subject: payload length
Date: Thu, 24 Dec 2009 16:34:18 +1000	[thread overview]
Message-ID: <328fe7150912232234g7381efafre6ad8b0825762f05@mail.gmail.com> (raw)

greetings,
perhaps someone be able assist me?
I made tine embedded tool so as to customize iptables rules, but I
can't add rules with proto and langth, only proto or length. what so I
did...

struct ipt_entry_match *match = NULL, *mlength = NULL,*tmp=NULL;
//whatever ******************************
//tmp = realloc( match, match->u.match_size + mlength->u.match_size );
tmp = realloc( mlength, mlength->u.match_size + match->u.match_size );
if( tmp ){
//memcpy( tmp + mlength->u.match_size, mlength, mlength->u.match_size );
memcpy( tmp + match->u.match_size, match, match->u.match_size );
match=malloc(tmp->u.match_size );
memcpy(match, tmp, tmp->u.match_size );
}
//whatever ******************************
if(match) memcpy(chain_entry->elems, match,match->u.match_size);

e.g. it works well it I use only match or mlength
ACCEPT     udp  --  10.20.30.40          anywhere            udp
spt:8889 dpt:555
ACCEPT     udp  --  10.20.30.40          anywhere            length 0:5
but I looking something like that...
ACCEPT     udp  --  10.20.30.40             anywhere            length
0:5 udp spt:666 dpt:777

I guess it had little bit specific with sequence or so?

                 reply	other threads:[~2009-12-24  6:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=328fe7150912232234g7381efafre6ad8b0825762f05@mail.gmail.com \
    --to=basteon@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).