Skip to contentSkip to conversation

nf_debug = 0 in arp.c and IPVS (Re: Fw: [PATCH] Fix of wrong ipt debug messages)

PATCH Harald Welte 1 participant 1 message Sep 2, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

wrong address of netfilter-devel in original mail...

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
Quoted 8 lines · David S. Miller
Quoted 5 lines
Quoted 3 lines

This patch fixes wrong ipt debug messages.
The problem is that when CONFIG_NETFILTER_DEBUG is set, parp_redo() can flood debug output like this:

I'm fine with this change, feel free to apply it (2.4.x and 2.6.x), Dave.

I thought about this change some more, and wouldn't a call to nf_reset() be more appropriate?

Indeed. It's not that much of a practical problem, since there is no connection tracking for arp packets... so whether we drop the nfct reference or not doesn't matter.

But in principle nf_reset() is more apropriate, since we re-submit the packet to the stack, and it will re-iterate the netfilter hooks (where in theory some not-existing-yet connection tracking module could be attached).

Please find the attached (untested) patch.

Quoted 3 lines

There are other places that explicitly clear nf_debug which also should probably be nf_reset() calls, all the IPVS xmit routines for example.

Mh, as I can see, the nf_debug statements are always followed by an unconditional IP_VS_XMIT, which has the packet iterate the LOCAL_OUT hook, thus any netfilter modules thinking of it being a locally-created packet. Therefore, it cannot belong to the previous, old connection but rather is part of a new connection.

I guess all IPVS users won't be using connection tracking - since the whole reason for IPVS' own state tracking was that ip_conntrack was apparently too slow for their purpose.

But if somebody would try to use IPVS and ip_conntrack on the same machine, he would definitely run into the check we do at ip_conntrack_in():

        /* Previously seen (loopback or untracked)?  Ignore. */
	        if ((*pskb)->nfct)
	                return NF_ACCEPT;

Where the packet bypasses all of conntrack and just appears like it
belongs to the original connection. While those semantics might seem
as apropriate as seeing two different connections, the current mode of operation clashes with any state-based operations, especially iptable_nat.

While again I find it a very hypothetical setup (combining ip_conntrack, iptable_nat and ipvs on one box), to me it is a bug. IPVS should be calling nf_reset instead of their nf_debug=0 statements.

It won't hurt them, since nf_reset is inlined, and as long as any sane user doesn't load ip_conntrack at the same time, there is no additional performance penalty.

btw: Just tried to find a MAINTAINERS entry for IPVS, but there apparently is none. Anybody from the IPVS team: please add one.

Quoted 1 line

Comments?

[why do I always feel stupid if I submit something and then you find the
most obvious errors. *sigh*

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
net/ipv4/arp.c +1 -0
@@ -695,6 +695,7 @@
 
 static void parp_redo(struct sk_buff *skb)
 {
+	nf_reset(skb);
 	arp_rcv(skb, skb->dev, NULL);
 }