From: Pierre Rondou <prondou@gmail.com>
To: netfilter-devel@vger.kernel.org, evyncke@cisco.com,
guy.leduc@ulg.ac.be, Cyril Soldani <cyril.soldani@ulg.ac.be>
Subject: icmp_send function broken?
Date: Tue, 24 May 2011 15:09:59 +0200 [thread overview]
Message-ID: <4DDBAE27.7020502@gmail.com> (raw)
Hello,
I'm a student at the University of Liege, currently developing a NAT64
(see RFC 6146) module for Netfilter.
I am using the icmp_send() function in my module to send icmp message in
case the packet represent an error (like, TTL exceeded or DEST_UNREACHABLE).
But it seems to be broken for me, the dst of the original packet doesn't
seem to be set.
I'm using 2.6.32-5 kernel to developp, but the function itself didn't
seem to have been updated in the 2.6.38 kernel.
The modification I had to apply is to re-execute the routing process on
the incoming paquet in order to get the ICMP packet sent:
if (!rt)
{
memset(&fl, 0, sizeof(fl));
fl.fl4_dst = oldip->daddr;
fl.fl4_tos = RT_TOS(oldip->tos);
fl.proto = skb_in->protocol;
if (ip_route_output_key(&init_net, &temp, &fl))
goto out;
if (!temp)
{
pr_info("NAT64: rt null\n");
goto out;
}
rt = temp;
}
instead of the simple
if (!rt)
// goto out;
Is there an other reason why the rtable of the incoming packet was not set?
Regards,
Pierre
next reply other threads:[~2011-05-24 13:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 13:09 Pierre Rondou [this message]
2011-05-24 13:26 ` icmp_send function broken? Eric Dumazet
2011-05-24 13:42 ` Pierre Rondou
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=4DDBAE27.7020502@gmail.com \
--to=prondou@gmail.com \
--cc=cyril.soldani@ulg.ac.be \
--cc=evyncke@cisco.com \
--cc=guy.leduc@ulg.ac.be \
--cc=netfilter-devel@vger.kernel.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.