Skip to contentSkip to conversation

seeking help on pom and other issues

DISCUSSION Null Device 2 participants 2 messages May 3, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

Hi list,

i tried using pom.
already have linux source, using 2.4.22-10mdk, downloaded iptables and pom-ng.

then after giving proper paths i ran ./runme from the directory where i extracted patch-o-matic-ng-20040302.tar.bz2 as root.

i want to install n use connlimit.
i found it in netfilter\extensions as well as pom-ng dir
when i run ./runme base
and when i press y for connlimit
i get an error
it states "newfile: 2 files in our way, unable to apply"
i am unable to get this. any help in this regard wud b invaluable.

Moreover for my modules which i am working on to learn netfilter and iptables. userspace program sets the parameters for the kernel module to work. in userspace code i first bzero a srtuct, fill it with port values whic i htons() brfore setting after setting required values . when used with ports 20 and 22 it turns the values into 5120 and 5632 (all in %d format) respective which i am sure are wrong and shuld have been sonething like 0020 or 0022. where i am slipping??.

as i have learned that for skbuff transport header (TCP/UDP/ICMP) do not exactly point to transport layer headers as supposed to b . as per this pharck article " One should note that the transport header and network header may very well point to the same location in memory. This
is the case for TCP packets where h and nh are both considered as
pointers to IP header structures. This means that attempting to get a
value from h->th thinking it's pointing to the TCP header will result in
false results because h->th will actually be pointing to the IP header,
just like nh->iph."
is it case with ICMP and UDP too?

any help in these matters wud b highly appriciated.

thx

__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

#1 lore raw
Quoted 11 lines · Null Device

i tried using pom.
already have linux source, using 2.4.22-10mdk, downloaded iptables and pom-ng.

when i run ./runme base
and when i press y for connlimit
i get an error
it states "newfile: 2 files in our way, unable to apply"
i am unable to get this. any help in this regard wud b invaluable.

Probably the 2.4.22-10mdk sources you are using already have connlimit applied..

Quoted 10 lines

Moreover for my modules which i am working on to learn netfilter and iptables. userspace program sets the parameters for the kernel module to work. in userspace code i first bzero a srtuct, fill it with port values whic i htons() brfore setting after setting required values . when used with ports 20 and 22 it turns the values into 5120 and 5632 (all in %d format) respective which i am sure are wrong and shuld have been sonething like 0020 or 0022. where i am slipping??.

Everything is correct. The values in the kernel is network byte order (high byte first) while your CPU is little endian (low byte first). See ntohs/htons functions.

If you look closely at the numbers you see that 5120 = 20 * 256, adn 5632 = 22 * 256.

network byte order is what you will see in packet data.

Quoted 3 lines

as i have learned that for skbuff transport header (TCP/UDP/ICMP) do not exactly point to transport layer headers as supposed to b.

The transport layer pointer is only guaranteed valid within the transport layer, and then only for the specific transport layer used.

The packet does not neccesarily even have a transport header by the time it is processed by netfilter. Consider for example a locally generated packet.

See ipt_mac.c for some guidance on how/when to do this kind of thing.

Quoted 1 line

is it case with ICMP and UDP too?

Yes.

Regards
Henrik