* payload length
@ 2009-12-24 6:34 basteon
0 siblings, 0 replies; only message in thread
From: basteon @ 2009-12-24 6:34 UTC (permalink / raw)
To: netfilter-devel, netfilter
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?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-12-24 6:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-24 6:34 payload length basteon
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).