All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Christian Hentschel <chentschel@arnet.com.ar>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: ip_nat_mangle_udp_packet problems
Date: Fri, 06 May 2005 20:36:33 +0200	[thread overview]
Message-ID: <427BB931.60709@trash.net> (raw)
In-Reply-To: <1115404044.1847.19.camel@www.l-chr.com.ar>

Christian Hentschel wrote:
> What i see in enlarge_skb() is that if packet is larger than 65536 it
> does as u said a copy.

No, it drops it if it gets this large. skb_copy_expand(), as it name
implies, copies the packet to a new one with more room.

> I see that enlarge_skb() does the "reload" of the pointer to pskb,
> pointing it to the enlarged skbuff. This is what u meant?
> 
>         kfree_skb(*pskb);
>         *pskb = nskb;
>         return 1;

Not really. What I meant is that if you have something like this before
the call to ip_nat_mangle_udp_packet():

struct udphdr *uh = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4;

then you need to reload the pointer after the call like this:

uh = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4;

otherwise it might point to the old and already freed skb.

> what is happening is really obscure for me.

Just post your code if this doesn't help.

Regards
Patrick

  reply	other threads:[~2005-05-06 18:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 16:32 ip_nat_mangle_udp_packet problems Christian Hentschel
2005-05-06 16:24 ` Patrick McHardy
2005-05-06 18:27   ` Christian Hentschel
2005-05-06 18:36     ` Patrick McHardy [this message]
2005-05-06 18:50       ` Christian Hentschel

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=427BB931.60709@trash.net \
    --to=kaber@trash.net \
    --cc=chentschel@arnet.com.ar \
    --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.