All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sérgio Bernardino" <sergio.bernardino@gmail.com>
To: netfilter-devel@lists.netfilter.org
Subject: LibIPQ issue
Date: Mon, 7 Mar 2005 12:51:40 +0000	[thread overview]
Message-ID: <e54bc1880503070451419fc57@mail.gmail.com> (raw)

Greetings to all.
I have a small problem in regards to libipq and the effects of
altering packets in userspace. I was wondering if anyone could help me
clear the issue. Here's the situation:
Consider three machines: A, B and C. They are located in a LAN. Now, i
sent a packet from A to B. On the machine B i have the following
iptables rule:

iptables -t mangle -A PREROUTING -p ip -j QUEUE

Inside the program i created to deal with the packets i queue into
userspace i change the destination address on the IP header to point
to the machine C and ACCEPT the packet with all the changes. Now, as
far as i can tell and for what i've gathered from reading this,

http://iptables-tutorial.frozentux.net/chunkyhtml/traversingoftables.html 

I'm changing the packet before the routing decision, hence, it should
continue to traverse the network and reach machine C instead of
"staying" on machine B. The thing is, nothing happens. I'm sure the
packet is valid, and that i recalculate the checksum correctly and
such since i've tested it several times. In fact, in the case where i
have the following iptables rule:

iptables -t filter -A OUTPUT -p ip -j QUEUE

I can alter the destination address of the outgoing packet (for
example, a packet that goes from A to B becomes a packet that goes
from A to A, a localhost packet), and it all works fine.
I seems like i'm doing something wrong but i can't quite figure out
what. Any ideas?
Thank you.
-- 
Sérgio Bernardino

============================================
"The Dragon awakens in the darkness
with a frozen heart he roars.
If you are close, the dragon sleeps
And when the wings appear before him
people's dreams will fill the sky..."

             reply	other threads:[~2005-03-07 12:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-07 12:51 Sérgio Bernardino [this message]
2005-03-07 13:10 ` LibIPQ issue Patrick McHardy
2005-03-07 19:17   ` Sérgio Bernardino
2005-03-07 19:30     ` Patrick McHardy
2005-03-08 23:08       ` Sérgio Bernardino
2005-03-08 23:29         ` Patrick McHardy
2005-03-08 23:30         ` Sven Schuster
2005-03-09  0:36           ` Sérgio Bernardino

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=e54bc1880503070451419fc57@mail.gmail.com \
    --to=sergio.bernardino@gmail.com \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.