From: Harald Welte <laforge@gnumonks.org>
To: Vishwas Raman <vishwas@eternal-systems.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Netfiltering - NF_IP_LOCAL_OUT - how it works???
Date: Thu, 21 Aug 2003 15:49:24 +0200 [thread overview]
Message-ID: <20030821134924.GJ7611@naboo> (raw)
In-Reply-To: <3F3C07E2.3000305@eternal-systems.com>
[-- Attachment #1: Type: text/plain, Size: 2038 bytes --]
Hi Vishwas, sorry for the late reply. Most netfilter developers have
been to the netfilter developer workshop, I guess.
you should ask this question on the netfilter-devel mailinglist, where
it is more on-topic than on lkml.
On Thu, Aug 14, 2003 at 03:06:26PM -0700, Vishwas Raman wrote:
> While initializing the module, I register a NF_IP_LOCAL_OUT hook for the
> outgoing packet and change skb->dst->output to my_ip_output() instead of
> ip_output() in that hook function. After loading the module, I see
> control being transferred to my_ip_output() for all outgoing packets
> which in turn calls ip_output() and everything seems to work well.
>
> The exit function of the module also unregisters the hook that I am using.
>
> The problem is that after I unload the module, which in turn unregisters
> the hook, I have a kernel panic happening each time I use TCP.
>
> The panic occurs at the following point, ip_build_and_send_pkt() in
> ip_output.c where it is trying to call
>
> NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
> output_maybe_reroute);
>
> I thought once the unregistering of the hook is done, it no longer looks
> for that hook function. I have no idea why it is failing. May be I am
> doing something grossly wrong with netfiltering. Anyone who is familiar
> with netfiltering and has registered and unregistered hooks before might
> be able to guide me regarding this.
I think either you are doing something wrong while unregistering from
the netfilter hook - or you are running into a race condition. It might
happen, that you assign the skb->dst->output function of a packet to
your function, and then you remove the module before that packet is
actually sent.
> -Vishwas.
--
- Harald Welte <laforge@gnumonks.org> http://www.gnumonks.org/
============================================================================
Programming is like sex: One mistake and you have to support it your lifetime
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2003-08-21 15:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-14 22:06 Netfiltering - NF_IP_LOCAL_OUT - how it works??? Vishwas Raman
2003-08-21 13:49 ` Harald Welte [this message]
2003-08-21 16:44 ` Vishwas Raman
2003-09-16 18:50 ` Incremental update of TCP Checksum Vishwas Raman
2003-09-16 19:00 ` Valdis.Kletnieks
2003-09-16 20:32 ` Vishwas Raman
2003-09-16 20:47 ` Leo Mauro
2003-09-17 3:28 ` Raf D'Halleweyn
2003-09-17 4:43 ` David S. Miller
2003-09-17 13:20 ` Richard B. Johnson
2003-09-17 20:34 ` Jamie Lokier
2003-09-16 19:47 ` Richard B. Johnson
2003-09-16 20:21 ` Vishwas Raman
2003-09-16 20:34 ` Richard B. Johnson
2003-09-16 20:35 ` Jesper Juhl
2003-09-17 1:37 ` Lincoln Dale
2003-09-17 1:39 ` Jesper Juhl
2003-09-16 22:41 ` Jamie Lokier
2003-09-16 23:32 ` Vishwas Raman
2003-09-16 20:33 ` Patrick McHardy
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=20030821134924.GJ7611@naboo \
--to=laforge@gnumonks.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vishwas@eternal-systems.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox