Skip to contentSkip to conversation

Handling packets in userspace with libipq

DISCUSSION Eduard Calvo (B-teljpa) EXP JAN 03 1 participant 1 message Dec 12, 2002 netfilter

lore
Share & tools
lore
#0 lore raw

Hi gurus!

I have a brand new ip_queue handler to do SNAT before routing. It is located
in PREROUTING, and everything related to the caching of the packets and its information seems to go right.

The problem arises when I have to return the NAT'ed packet to the next hook
with ip_set_verdict. I don't know quite well how to tell the kernel to get the modifyed packet and not the copy it has.

In my code I have:

	ret = ipq_set_verdict(qh, p->packet_id, NF_ACCEPT, (int) 

ip_header->tot_len, p->payload);

And ret takes always -1.

Where: "p" is a ipq_message_t struct pointer that refers to the
modified packet read with ipq_read ant then ipq_get_packet.
"ip_header" is a iphdr struct pointer that starts in
p->payload.

Do you have any idea?
Thanks in advanced.

Eduard

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/