Skip to contentSkip to conversation

New: Compilation of .tmp_linux1 fails due to missing declaration in net/netfilter/xt_physdev.c

Bugme-new In review Andrew Morton 3 participants 11 messages Sep 21, 2006 – Sep 22, 2006

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

Methinks CONFIG_NETFILTER_XT_TARGET_CLASSIFY should depend upon CONFIG_BRIDGE_NETFILTER. Because brnf_deferred_hooks is defined in net/bridge/br_netfilter.c and is referred to in net/netfilter/xt_physdev.c.

Or something else ;)

Begin forwarded message:

Date: Thu, 21 Sep 2006 14:41:13 -0700
From: [email protected]
To: [email protected]
Subject: [Bugme-new] [Bug 7179] New: Compilation of .tmp_linux1 fails due to missing declaration in net/netfilter/xt_physdev.c

http://bugzilla.kernel.org/show_bug.cgi?id=7179

Summary: Compilation of .tmp_linux1 fails due to missing
declaration in net/netfilter/xt_physdev.c
Kernel Version: 2.6.18
Status: NEW
Severity: high
Owner: [email protected]
Submitter: [email protected]

Most recent kernel where this bug did not occur: 2.6.17.13
Distribution: CentOS
Hardware Environment: Dual Intel Xeon 5160 Software Environment: gcc 3.4.6, glibc 2.3.4, make 3.8 Problem Description:

Using the same config from 2.6.17.13, kernel 2.6.18 fails on make when attempting to make .tmp_vmlinux1

LD .tmp_vmlinux1
net/built-in.o(.text.checkentry+0x1e1): In function `checkentry':
net/netfilter/xt_physdev.c:130: undefined reference to `brnf_deferred_hooks'
make: *** [.tmp_vmlinux1] Error 1

Line 130 is simply "brnf_deferred_hooks = 1;" This variable is also used on line 118.

Adding

"int brnf_deferred_hooks = 0;"

in a line before line 104 (static int) will cause .tmp_vmlinux1 to be successfully created, and make will finish successfully. However, it will generate a warning (seen below) on now line 119 which can be fixed by changing it to:

"if ((brnf_deferred_hooks == 0) & (info->bitmask & XT_PHYSDEV_OP_OUT) && "

The warning generated is:

net/netfilter/xt_physdev.c: In function `checkentry':
net/netfilter/xt_physdev.c:118: warning: ISO C90 forbids mixed declarations and code

The kernel produced after making these changes works fine

Steps to reproduce:

I am unsure of which kernel .config parameter is sparking this. My .config can be found here: http://www.animeforum.com/jakiao/misato.config

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

#1 lore raw
Quoted 7 lines · Andrew Morton

Methinks CONFIG_NETFILTER_XT_TARGET_CLASSIFY should depend upon CONFIG_BRIDGE_NETFILTER. Because brnf_deferred_hooks is defined in net/bridge/br_netfilter.c and is referred to in net/netfilter/xt_physdev.c.

Or something else ;)

From net/netfilter/Kconfig:

config NETFILTER_XT_MATCH_PHYSDEV
tristate '"physdev" match support' depends on NETFILTER_XTABLES && BRIDGE_NETFILTER

so "properly" generated .config should be enough.

Jarek P.

PS: I've just checked and it compiles OK.

#2 lore raw

Sorry linux-kernel - it should go to netdev.

Quoted 18 lines · Jarek Poplawski
Quoted 5 lines · Andrew Morton

Methinks CONFIG_NETFILTER_XT_TARGET_CLASSIFY should depend upon CONFIG_BRIDGE_NETFILTER. Because brnf_deferred_hooks is defined in net/bridge/br_netfilter.c and is referred to in net/netfilter/xt_physdev.c.

Or something else ;)

From net/netfilter/Kconfig:

config NETFILTER_XT_MATCH_PHYSDEV
tristate '"physdev" match support' depends on NETFILTER_XTABLES && BRIDGE_NETFILTER

so "properly" generated .config should be enough.

Jarek P.

PS: I've just checked and it compiles OK.

#3 lore raw
In reply to Andrew Morton
Quoted 5 lines · Andrew Morton

Methinks CONFIG_NETFILTER_XT_TARGET_CLASSIFY should depend upon CONFIG_BRIDGE_NETFILTER. Because brnf_deferred_hooks is defined in net/bridge/br_netfilter.c and is referred to in net/netfilter/xt_physdev.c.

Or something else ;)

...

Quoted 2 lines

I am unsure of which kernel .config parameter is sparking this. My .config can be found here: http://www.animeforum.com/jakiao/misato.config

I don't see CONFIG_BRIDGE set in this misato.config, so CONFIG_BRIDGE_NETFILTER was set in some unofficial way.

Jarek P.

#4 lore raw
Quoted 5 lines · Jarek Poplawski
Quoted 4 lines · Andrew Morton

Methinks CONFIG_NETFILTER_XT_TARGET_CLASSIFY should depend upon CONFIG_BRIDGE_NETFILTER. Because brnf_deferred_hooks is defined in net/bridge/br_netfilter.c and is referred to in net/netfilter/xt_physdev.c.

Quoted 7 lines
Quoted 1 line

Or something else ;)

...

Quoted 2 lines

I am unsure of which kernel .config parameter is sparking this. My .config can be found here: http://www.animeforum.com/jakiao/misato.config

I don't see CONFIG_BRIDGE set in this misato.config, so CONFIG_BRIDGE_NETFILTER was set in some unofficial way.

... or I'm blind! Sorry.

There is CONFIG_BRIDGE=m and this is the source of a problem:
config shouldn't allow for:

CONFIG_NETFILTER_BRIDGE=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y

Jarek P.

#5 lore raw

PATCH 1/1 New: Compilation of .tmp_linux1 fails due to missing declaration in net/netfilter/xt_physdev.c

On Fri, Sep 22, 2006 at 11:27:31AM +0200, Jarek Poplawski wrote:
...

Quoted 5 lines

There is CONFIG_BRIDGE=m and this is the source of a problem:
config shouldn't allow for:

CONFIG_NETFILTER_BRIDGE=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y

So here is a patch proposal.

Jarek P.

net/Kconfig +1 -1
diff -Nurp linux-2.6.18-/net/Kconfig linux-2.6.18/net/Kconfig
@@ -143,7 +143,7 @@ config NETFILTER_DEBUG
 
 config BRIDGE_NETFILTER
 	bool "Bridged IP/ARP packets filtering"
-	depends on BRIDGE && NETFILTER && INET
+	depends on BRIDGE=y && NETFILTER && INET
 	default y
 	---help---
 	  Enabling this option will let arptables resp. iptables see bridged
#6 lore raw
Quoted 18 lines · Jarek Poplawski

On Fri, Sep 22, 2006 at 11:27:31AM +0200, Jarek Poplawski wrote:
...

Quoted 5 lines

There is CONFIG_BRIDGE=m and this is the source of a problem:
config shouldn't allow for:

CONFIG_NETFILTER_BRIDGE=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y

So here is a patch proposal.

Jarek P.

diff -Nurp linux-2.6.18-/net/Kconfig linux-2.6.18/net/Kconfig

net/Kconfig config NETFILTER_DEBUG · line 146

Quoted 5 lines
net/Kconfig +1 -1
@@ -143,7 +143,7 @@ config NETFILTER_DEBUG
 
 config BRIDGE_NETFILTER
 	bool "Bridged IP/ARP packets filtering"
-	depends on BRIDGE && NETFILTER && INET
+	depends on BRIDGE=y && NETFILTER && INET

We should fix the physdev dependencies since this is what is causing problems.

net/netfilter/Kconfig +1 -1
index 0a28d2c..ce94732 100644
@@ -365,7 +365,7 @@ config NETFILTER_XT_MATCH_MULTIPORT
 
 config NETFILTER_XT_MATCH_PHYSDEV
 	tristate '"physdev" match support'
-	depends on NETFILTER_XTABLES && BRIDGE_NETFILTER
+	depends on NETFILTER_XTABLES && BRIDGE && BRIDGE_NETFILTER
 	help
 	  Physdev packet matching matches against the physical bridge ports
 	  the IP packet arrived on or will leave by.
#7 lore raw

On Fri, Sep 22, 2006 at 12:15:43PM +0200, Patrick McHardy wrote:
...

Quoted 2 lines

We should fix the physdev dependencies since this is what is causing problems.

...

net/netfilter/Kconfig config NETFILTER_XT_MATCH_MULTIPORT · line 368

Quoted 4 lines

config NETFILTER_XT_MATCH_PHYSDEV

net/netfilter/Kconfig +1 -1
 	tristate '"physdev" match support'
-	depends on NETFILTER_XTABLES && BRIDGE_NETFILTER
+	depends on NETFILTER_XTABLES && BRIDGE && BRIDGE_NETFILTER

Sure! But someone may ask what for BRIDGE_NETFILTER depends on BRIDGE if you should repeat this?

Jarek P.

#8 lore raw
Quoted 8 lines · Jarek Poplawski

On Fri, Sep 22, 2006 at 12:15:43PM +0200, Patrick McHardy wrote:
...

Quoted 2 lines

We should fix the physdev dependencies since this is what is causing problems.

...

Quoted 8 lines

net/netfilter/Kconfig config NETFILTER_XT_MATCH_MULTIPORT · line 368

Quoted 4 lines

config NETFILTER_XT_MATCH_PHYSDEV
tristate '"physdev" match support'

net/netfilter/Kconfig +1 -1
-	depends on NETFILTER_XTABLES && BRIDGE_NETFILTER
+	depends on NETFILTER_XTABLES && BRIDGE && BRIDGE_NETFILTER

Sure! But someone may ask what for BRIDGE_NETFILTER depends on BRIDGE if you should repeat this?

Simply because it really depends on BRIDGE. The reason why we need BRIDGE as dependency here also is because BRIDGE_NETFILTER is a boolean, but may still result in a module because of special logic in the bridge makefile.

#9 lore raw
Quoted 18 lines · Patrick McHardy
Quoted 8 lines · Jarek Poplawski

On Fri, Sep 22, 2006 at 12:15:43PM +0200, Patrick McHardy wrote:
...

Quoted 2 lines

We should fix the physdev dependencies since this is what is causing problems.

...

Quoted 8 lines

net/netfilter/Kconfig config NETFILTER_XT_MATCH_MULTIPORT · line 368

Quoted 4 lines

config NETFILTER_XT_MATCH_PHYSDEV
tristate '"physdev" match support'

net/netfilter/Kconfig +1 -1
-	depends on NETFILTER_XTABLES && BRIDGE_NETFILTER
+	depends on NETFILTER_XTABLES && BRIDGE && BRIDGE_NETFILTER

Sure! But someone may ask what for BRIDGE_NETFILTER depends on BRIDGE if you should repeat this?

Quoted 4 lines

Simply because it really depends on BRIDGE. The reason why we need BRIDGE as dependency here also is because BRIDGE_NETFILTER is a boolean, but may still result in a module because of special logic in the bridge makefile.

Anyway this special logic is also something misleading:

a) BRIDGE_NETFILTER=y and BRIDGE_NETFILTER depends on BRIDGE sugest something which depends on BRIDGE is compiled into kernel, which is usually impossible if BRIDGE=m

b) let's assume a) is right; shouldn't this dependency be automatically added to _PHYSDEV etc.? I mean config script behavior - not bridge makefile.

Thanks for explanation - my best regards,

Jarek P.

#10 lore raw
Quoted 9 lines · Jarek Poplawski

Anyway this special logic is also something misleading:

a) BRIDGE_NETFILTER=y and BRIDGE_NETFILTER depends on BRIDGE sugest something which depends on BRIDGE is compiled into kernel, which is usually impossible if BRIDGE=m

b) let's assume a) is right; shouldn't this dependency be automatically added to _PHYSDEV etc.? I mean config script behavior - not bridge makefile.

Frankly, I don't care. And I'm definitely not interested in hacking Kconfig.