All of lore.kernel.org
 help / color / mirror / Atom feed
From: Devesh Agrawal <devesh.agrawal@gmail.com>
To: netfilter-devel@lists.netfilter.org
Subject: Re: Newbie question about fragmentation and the PRE_ROUTING hook
Date: Sat, 26 Mar 2005 05:02:02 +0530	[thread overview]
Message-ID: <db01ab350503251532128566c@mail.gmail.com> (raw)
In-Reply-To: <db01ab3505032511079d11ea4@mail.gmail.com>

Hi,
Just to add some more info:
I wrote a simple src routing protocol , which adds a new hdr b/w the
ip and the tcp headers. I fragment a packet, such that each fragment
has the ip and my header (so that I decide the route for every frag).
However if I allow the kernel to reassemble my fragments it will screw
things up for me as it does not know anything about my header. Hence I
want to process each of the fragments in pre route as it is (basically
I remove my header and pass it up to local_in, where it can be
defragged in ip_local_deliver before calling my local in hander).
I have given NF_IP_PRE_FIRST priority to my pre route handler, but
still it is getting some screwed up reassembled packet, as probably
Netfilter is trying to reassemble my packet and hence messing it up.
I read up that conntrack defrags the packet, but it does so with a
lower priority (higher value) than NF_IP_PRE_FIRST, inspite of all
this, I do not know why my pre route handler is getting a defragged
packet. Any idea of what I am missing out.
PS: My sender explicitly frags a packet if its size is greater than
some value (currently set to 500). Hence I am sure that I am
generating those fragments. I will be greatful for any insight into
this problem.
Regards,
Devesh Agrawal

On Sat, 26 Mar 2005 00:37:41 +0530, Devesh Agrawal
<devesh.agrawal@gmail.com> wrote:
> Hi,
> I have a very basic question about netfilter and IP fragments. My
> understanding is that the pre routing hook gets the fragmented packet
> , which is later in defragged in local in in the ip_local_input funx.
> ie If I print the skb in pre route hook, I shall get the individual
> frags, whereas in local in hook I would get the complete packet. Is
> this absolutely correct ?
> Am I gettting the right picture or is there anything else that I should know?
> I would be grateful if someone could clear my doubt.
> Sincerely,
> Devesh Agrawal
> 


-- 
Devesh Agrawal
4th year Dual Degree.
Dept of CSE 
Indian Institute of Technology , Madras
Room No . 309 , Alakananda Hostel 
Chennai 600036 ,India
Ph : +91 9382102431

  reply	other threads:[~2005-03-25 23:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 14:47 is this make sense: iptables -A PREROUTING -t nat -j SNAT --to 0.0.0.0 Nguyen Dinh Nam
2005-03-22 14:55 ` Max Kellermann
2005-03-22 18:56   ` Nguyen Dinh Nam
2005-03-25 17:28 ` Nguyen Dinh Nam
2005-03-25 19:07   ` Newbie question about fragmentation and the PRE_ROUTING hook Devesh Agrawal
2005-03-25 23:32     ` Devesh Agrawal [this message]
2005-03-26 12:03   ` is this make sense: iptables -A PREROUTING -t nat -j SNAT --to 0.0.0.0 Jonas Berlin
2005-03-26 15:02     ` Nguyen Dinh Nam

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=db01ab350503251532128566c@mail.gmail.com \
    --to=devesh.agrawal@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.