[nf] netfilter: xt_TEE: fix build failure
diff mbox series

Message ID 20181118143903.22008-1-ap420073@gmail.com
State Deferred
Delegated to: Pablo Neira
Headers show
Series
  • [nf] netfilter: xt_TEE: fix build failure
Related show

Commit Message

Taehee Yoo Nov. 18, 2018, 2:39 p.m. UTC
xt_TEE.c needs nf_dup_ipv6.c to support ipv6 packet duplication.
So that if xt_TEE is enabled, nf_dup_ipv6 will be automatically selected.
But there is build failure scenario.

test config:
CONFIG_NETFILTER_XT_TARGET_TEE=y
CONFIG_NF_DUP_IPV6=m

compile result:
net/netfilter/xt_TEE.o: In function `tee_tg6':
net/netfilter/xt_TEE.c:57: undefined reference to `nf_dup_ipv6'

This patch forces to avoid above config.

Fixes: 5d400a4933e8 ("netfilter: Kconfig: Change select IPv6 dependencies")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
 net/netfilter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Randy Dunlap Nov. 18, 2018, 5:15 p.m. UTC | #1
On 11/18/18 6:39 AM, Taehee Yoo wrote:
> xt_TEE.c needs nf_dup_ipv6.c to support ipv6 packet duplication.
> So that if xt_TEE is enabled, nf_dup_ipv6 will be automatically selected.
> But there is build failure scenario.
> 
> test config:
> CONFIG_NETFILTER_XT_TARGET_TEE=y
> CONFIG_NF_DUP_IPV6=m
> 
> compile result:
> net/netfilter/xt_TEE.o: In function `tee_tg6':
> net/netfilter/xt_TEE.c:57: undefined reference to `nf_dup_ipv6'
> 
> This patch forces to avoid above config.
> 
> Fixes: 5d400a4933e8 ("netfilter: Kconfig: Change select IPv6 dependencies")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>

Hi,
This does fix the build error, so
Acked-by: Randy Dunlap <rdunlap@infradead.org>

The patch causes this:
  CONFIG_NF_DUP_IPV6=m
to become this:
  CONFIG_NF_DUP_IPV6=y

I understand how the above change fixes the build error, but I don't
see how the change to the Kconfig below file causes the resulting
.config file change above.

Do you?  Can you explain it?  Thanks.

> ---
>  net/netfilter/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
> index 2ab870ef233a..a0c2712290ea 100644
> --- a/net/netfilter/Kconfig
> +++ b/net/netfilter/Kconfig
> @@ -1011,7 +1011,7 @@ config NETFILTER_XT_TARGET_TEE
>  	depends on IPV6 || IPV6=n
>  	depends on !NF_CONNTRACK || NF_CONNTRACK
>  	select NF_DUP_IPV4
> -	select NF_DUP_IPV6 if IP6_NF_IPTABLES
> +	select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
>  	---help---
>  	This option adds a "TEE" target with which a packet can be cloned and
>  	this clone be rerouted to another nexthop.
>
Taehee Yoo Nov. 19, 2018, 2:37 a.m. UTC | #2
On Mon, 19 Nov 2018 at 02:15, Randy Dunlap <rdunlap@infradead.org> wrote:
>
> On 11/18/18 6:39 AM, Taehee Yoo wrote:
> > xt_TEE.c needs nf_dup_ipv6.c to support ipv6 packet duplication.
> > So that if xt_TEE is enabled, nf_dup_ipv6 will be automatically selected.
> > But there is build failure scenario.
> >
> > test config:
> > CONFIG_NETFILTER_XT_TARGET_TEE=y
> > CONFIG_NF_DUP_IPV6=m
> >
> > compile result:
> > net/netfilter/xt_TEE.o: In function `tee_tg6':
> > net/netfilter/xt_TEE.c:57: undefined reference to `nf_dup_ipv6'
> >
> > This patch forces to avoid above config.
> >
> > Fixes: 5d400a4933e8 ("netfilter: Kconfig: Change select IPv6 dependencies")
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Reported-by: Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Taehee Yoo <ap420073@gmail.com>
>
> Hi,

Hi!
Thank you for review!

> This does fix the build error, so
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
>
> The patch causes this:
>   CONFIG_NF_DUP_IPV6=m
> to become this:
>   CONFIG_NF_DUP_IPV6=y
>
> I understand how the above change fixes the build error, but I don't
> see how the change to the Kconfig below file causes the resulting
> .config file change above.
>
> Do you?  Can you explain it?  Thanks.
>

My understanding is that:
   1. select NF_DUP_IPV6 if IP6_NF_IPTABLES
   2. select NF_DUP_IPV6 if IP6_NF_IPTABLES != n

First statement means that
NF_DUP_IPV6 can't be lower than IP6_NF_IPTABLES.
for example,
If NF_DUP_IPV6 is 'm', NF_DUP_IPV6 can be 'm' or 'y'.
If NF_DUP_IPV6 is 'y', NF_DUP_IPV6 can be only 'y'

Second statement means that
NF_DUP_IPV6 will be set the same value of NETFILTER_XT_TARGET_TEE
if IP6_NF_IPTABLES value is not 'n'.

My understanding might be wrong. If so, please let me know!

Thanks!


> > ---
> >  net/netfilter/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
> > index 2ab870ef233a..a0c2712290ea 100644
> > --- a/net/netfilter/Kconfig
> > +++ b/net/netfilter/Kconfig
> > @@ -1011,7 +1011,7 @@ config NETFILTER_XT_TARGET_TEE
> >       depends on IPV6 || IPV6=n
> >       depends on !NF_CONNTRACK || NF_CONNTRACK
> >       select NF_DUP_IPV4
> > -     select NF_DUP_IPV6 if IP6_NF_IPTABLES
> > +     select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
> >       ---help---
> >       This option adds a "TEE" target with which a packet can be cloned and
> >       this clone be rerouted to another nexthop.
> >
>
>
> --
> ~Randy
Taehee Yoo Nov. 26, 2018, 9:39 a.m. UTC | #3
Hi Pablo,

According to Masahiro Yamada, this is Kconfig bug and he is fixing Kconfig.
https://lkml.org/lkml/2018/11/26/291

So that I think this patch will be useless.
Could you check it up?

Thanks!

On Sun, 18 Nov 2018 at 23:39, Taehee Yoo <ap420073@gmail.com> wrote:
>
> xt_TEE.c needs nf_dup_ipv6.c to support ipv6 packet duplication.
> So that if xt_TEE is enabled, nf_dup_ipv6 will be automatically selected.
> But there is build failure scenario.
>
> test config:
> CONFIG_NETFILTER_XT_TARGET_TEE=y
> CONFIG_NF_DUP_IPV6=m
>
> compile result:
> net/netfilter/xt_TEE.o: In function `tee_tg6':
> net/netfilter/xt_TEE.c:57: undefined reference to `nf_dup_ipv6'
>
> This patch forces to avoid above config.
>
> Fixes: 5d400a4933e8 ("netfilter: Kconfig: Change select IPv6 dependencies")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> ---
>  net/netfilter/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
> index 2ab870ef233a..a0c2712290ea 100644
> --- a/net/netfilter/Kconfig
> +++ b/net/netfilter/Kconfig
> @@ -1011,7 +1011,7 @@ config NETFILTER_XT_TARGET_TEE
>         depends on IPV6 || IPV6=n
>         depends on !NF_CONNTRACK || NF_CONNTRACK
>         select NF_DUP_IPV4
> -       select NF_DUP_IPV6 if IP6_NF_IPTABLES
> +       select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
>         ---help---
>         This option adds a "TEE" target with which a packet can be cloned and
>         this clone be rerouted to another nexthop.
> --
> 2.17.1
>
Pablo Neira Ayuso Nov. 26, 2018, 11:27 a.m. UTC | #4
On Mon, Nov 26, 2018 at 06:39:28PM +0900, Taehee Yoo wrote:
> Hi Pablo,
> 
> According to Masahiro Yamada, this is Kconfig bug and he is fixing Kconfig.
> https://lkml.org/lkml/2018/11/26/291
> 
> So that I think this patch will be useless.
> Could you check it up?

OK, will keep back your patch by now, if this fix for Kbuild is still
not fixing up the problem, then robots will spot this again.

Thanks!

> On Sun, 18 Nov 2018 at 23:39, Taehee Yoo <ap420073@gmail.com> wrote:
> >
> > xt_TEE.c needs nf_dup_ipv6.c to support ipv6 packet duplication.
> > So that if xt_TEE is enabled, nf_dup_ipv6 will be automatically selected.
> > But there is build failure scenario.
> >
> > test config:
> > CONFIG_NETFILTER_XT_TARGET_TEE=y
> > CONFIG_NF_DUP_IPV6=m
> >
> > compile result:
> > net/netfilter/xt_TEE.o: In function `tee_tg6':
> > net/netfilter/xt_TEE.c:57: undefined reference to `nf_dup_ipv6'
> >
> > This patch forces to avoid above config.
> >
> > Fixes: 5d400a4933e8 ("netfilter: Kconfig: Change select IPv6 dependencies")
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Reported-by: Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> > ---
> >  net/netfilter/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
> > index 2ab870ef233a..a0c2712290ea 100644
> > --- a/net/netfilter/Kconfig
> > +++ b/net/netfilter/Kconfig
> > @@ -1011,7 +1011,7 @@ config NETFILTER_XT_TARGET_TEE
> >         depends on IPV6 || IPV6=n
> >         depends on !NF_CONNTRACK || NF_CONNTRACK
> >         select NF_DUP_IPV4
> > -       select NF_DUP_IPV6 if IP6_NF_IPTABLES
> > +       select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
> >         ---help---
> >         This option adds a "TEE" target with which a packet can be cloned and
> >         this clone be rerouted to another nexthop.
> > --
> > 2.17.1
> >
Taehee Yoo Nov. 26, 2018, noon UTC | #5
On Mon, 26 Nov 2018 at 20:28, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> On Mon, Nov 26, 2018 at 06:39:28PM +0900, Taehee Yoo wrote:
> > Hi Pablo,
> >
> > According to Masahiro Yamada, this is Kconfig bug and he is fixing Kconfig.
> > https://lkml.org/lkml/2018/11/26/291
> >
> > So that I think this patch will be useless.
> > Could you check it up?
>
> OK, will keep back your patch by now, if this fix for Kbuild is still
> not fixing up the problem, then robots will spot this again.
>

Okay, Thank you for checking!

> Thanks!
>
> > On Sun, 18 Nov 2018 at 23:39, Taehee Yoo <ap420073@gmail.com> wrote:
> > >
> > > xt_TEE.c needs nf_dup_ipv6.c to support ipv6 packet duplication.
> > > So that if xt_TEE is enabled, nf_dup_ipv6 will be automatically selected.
> > > But there is build failure scenario.
> > >
> > > test config:
> > > CONFIG_NETFILTER_XT_TARGET_TEE=y
> > > CONFIG_NF_DUP_IPV6=m
> > >
> > > compile result:
> > > net/netfilter/xt_TEE.o: In function `tee_tg6':
> > > net/netfilter/xt_TEE.c:57: undefined reference to `nf_dup_ipv6'
> > >
> > > This patch forces to avoid above config.
> > >
> > > Fixes: 5d400a4933e8 ("netfilter: Kconfig: Change select IPv6 dependencies")
> > > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > > Reported-by: Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> > > ---
> > >  net/netfilter/Kconfig | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
> > > index 2ab870ef233a..a0c2712290ea 100644
> > > --- a/net/netfilter/Kconfig
> > > +++ b/net/netfilter/Kconfig
> > > @@ -1011,7 +1011,7 @@ config NETFILTER_XT_TARGET_TEE
> > >         depends on IPV6 || IPV6=n
> > >         depends on !NF_CONNTRACK || NF_CONNTRACK
> > >         select NF_DUP_IPV4
> > > -       select NF_DUP_IPV6 if IP6_NF_IPTABLES
> > > +       select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
> > >         ---help---
> > >         This option adds a "TEE" target with which a packet can be cloned and
> > >         this clone be rerouted to another nexthop.
> > > --
> > > 2.17.1
> > >

Patch
diff mbox series

diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 2ab870ef233a..a0c2712290ea 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -1011,7 +1011,7 @@  config NETFILTER_XT_TARGET_TEE
 	depends on IPV6 || IPV6=n
 	depends on !NF_CONNTRACK || NF_CONNTRACK
 	select NF_DUP_IPV4
-	select NF_DUP_IPV6 if IP6_NF_IPTABLES
+	select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
 	---help---
 	This option adds a "TEE" target with which a packet can be cloned and
 	this clone be rerouted to another nexthop.