diff mbox series

[v2,1/1] xt_ECHO, xt_TARPIT: make properly conditional on IPv6

Message ID 20210926195734.702772-1-philipp@redfish-solutions.com
State Awaiting Upstream
Delegated to: Pablo Neira
Headers show
Series [v2,1/1] xt_ECHO, xt_TARPIT: make properly conditional on IPv6 | expand

Commit Message

Philip Prindeville Sept. 26, 2021, 7:57 p.m. UTC
From: Philip Prindeville <philipp@redfish-solutions.com>

Not all modules compile equally well when CONFIG_IPv6 is disabled.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
---
 extensions/xt_ECHO.c   | 19 ++++++++++++++-----
 extensions/xt_TARPIT.c |  2 ++
 2 files changed, 16 insertions(+), 5 deletions(-)

Comments

Jan Engelhardt Sept. 28, 2021, 9:43 a.m. UTC | #1
On Sunday 2021-09-26 21:57, Philip Prindeville wrote:

>From: Philip Prindeville <philipp@redfish-solutions.com>
>
>Not all modules compile equally well when CONFIG_IPv6 is disabled.
>
> 	{
> 		.name       = "ECHO",
> 		.revision   = 0,
>-		.family     = NFPROTO_IPV6,
>+		.family     = NFPROTO_IPV4,
> 		.proto      = IPPROTO_UDP,
> 		.table      = "filter",
>-		.target     = echo_tg6,
>+		.target     = echo_tg4,
> 		.me         = THIS_MODULE,
> 	},
>+#ifdef WITH_IPV6

I put the original order back, makes the diff smaller.
So added.
Philip Prindeville Jan. 31, 2022, 4:53 a.m. UTC | #2
Did this get merged?

Last commit I saw was:

commit c90ecf4320289e2567f2b6dee0c6c21d9d51b145
Author: Jeff Carlson <jeff@ultimateevil.org>
Date:   Sun Aug 15 18:59:25 2021 -0700

    pknock:  added UDP options to help and made whitespace consistent


Thanks


> On Sep 28, 2021, at 3:43 AM, Jan Engelhardt <jengelh@inai.de> wrote:
> 
> On Sunday 2021-09-26 21:57, Philip Prindeville wrote:
> 
>> From: Philip Prindeville <philipp@redfish-solutions.com>
>> 
>> Not all modules compile equally well when CONFIG_IPv6 is disabled.
>> 
>> 	{
>> 		.name       = "ECHO",
>> 		.revision   = 0,
>> -		.family     = NFPROTO_IPV6,
>> +		.family     = NFPROTO_IPV4,
>> 		.proto      = IPPROTO_UDP,
>> 		.table      = "filter",
>> -		.target     = echo_tg6,
>> +		.target     = echo_tg4,
>> 		.me         = THIS_MODULE,
>> 	},
>> +#ifdef WITH_IPV6
> 
> I put the original order back, makes the diff smaller.
> So added.
>
Jeremy Sowden Jan. 31, 2022, 10:24 a.m. UTC | #3
On 2022-01-30, at 21:53:26 -0700, Philip Prindeville wrote:
> On Sep 28, 2021, at 3:43 AM, Jan Engelhardt <jengelh@inai.de> wrote:
> > On Sunday 2021-09-26 21:57, Philip Prindeville wrote:
> >> From: Philip Prindeville <philipp@redfish-solutions.com>
> >>
> >> Not all modules compile equally well when CONFIG_IPv6 is disabled.
> >>
> >> 	{
> >> 		.name       = "ECHO",
> >> 		.revision   = 0,
> >> -		.family     = NFPROTO_IPV6,
> >> +		.family     = NFPROTO_IPV4,
> >> 		.proto      = IPPROTO_UDP,
> >> 		.table      = "filter",
> >> -		.target     = echo_tg6,
> >> +		.target     = echo_tg4,
> >> 		.me         = THIS_MODULE,
> >> 	},
> >> +#ifdef WITH_IPV6
> >
> > I put the original order back, makes the diff smaller.
> > So added.
>
> Did this get merged?

It did.  It's currently at the tip of master.

> Last commit I saw was:
>
> commit c90ecf4320289e2567f2b6dee0c6c21d9d51b145
> Author: Jeff Carlson <jeff@ultimateevil.org>
> Date:   Sun Aug 15 18:59:25 2021 -0700
>
>     pknock:  added UDP options to help and made whitespace consistent

J.
Philip Prindeville Jan. 31, 2022, 6:27 p.m. UTC | #4
> On Jan 31, 2022, at 3:24 AM, Jeremy Sowden <jeremy@azazel.net> wrote:
> 
> On 2022-01-30, at 21:53:26 -0700, Philip Prindeville wrote:
>> On Sep 28, 2021, at 3:43 AM, Jan Engelhardt <jengelh@inai.de> wrote:
>>> On Sunday 2021-09-26 21:57, Philip Prindeville wrote:
>>>> From: Philip Prindeville <philipp@redfish-solutions.com>
>>>> 
>>>> Not all modules compile equally well when CONFIG_IPv6 is disabled.
>>>> 
>>>> 	{
>>>> 		.name       = "ECHO",
>>>> 		.revision   = 0,
>>>> -		.family     = NFPROTO_IPV6,
>>>> +		.family     = NFPROTO_IPV4,
>>>> 		.proto      = IPPROTO_UDP,
>>>> 		.table      = "filter",
>>>> -		.target     = echo_tg6,
>>>> +		.target     = echo_tg4,
>>>> 		.me         = THIS_MODULE,
>>>> 	},
>>>> +#ifdef WITH_IPV6
>>> 
>>> I put the original order back, makes the diff smaller.
>>> So added.
>> 
>> Did this get merged?
> 
> It did.  It's currently at the tip of master.


Did we change repo sites?  I'm not seeing it here:

https://sourceforge.net/p/xtables-addons/xtables-addons/ci/e3ae438e2e23f0849c756604a4518315e097ad62/log/?path=/extensions/xt_ECHO.c


> 
>> Last commit I saw was:
>> 
>> commit c90ecf4320289e2567f2b6dee0c6c21d9d51b145
>> Author: Jeff Carlson <jeff@ultimateevil.org>
>> Date:   Sun Aug 15 18:59:25 2021 -0700
>> 
>>    pknock:  added UDP options to help and made whitespace consistent
> 
> J.
Jeremy Sowden Jan. 31, 2022, 6:31 p.m. UTC | #5
On 2022-01-31, at 11:27:25 -0700, Philip Prindeville wrote:
> On Jan 31, 2022, at 3:24 AM, Jeremy Sowden <jeremy@azazel.net> wrote:
> > On 2022-01-30, at 21:53:26 -0700, Philip Prindeville wrote:
> > > On Sep 28, 2021, at 3:43 AM, Jan Engelhardt <jengelh@inai.de> wrote:
> > > > On Sunday 2021-09-26 21:57, Philip Prindeville wrote:
> > > > > From: Philip Prindeville <philipp@redfish-solutions.com>
> > > > >
> > > > > Not all modules compile equally well when CONFIG_IPv6 is disabled.
> > > > >
> > > > > 	{
> > > > > 		.name       = "ECHO",
> > > > > 		.revision   = 0,
> > > > > -		.family     = NFPROTO_IPV6,
> > > > > +		.family     = NFPROTO_IPV4,
> > > > > 		.proto      = IPPROTO_UDP,
> > > > > 		.table      = "filter",
> > > > > -		.target     = echo_tg6,
> > > > > +		.target     = echo_tg4,
> > > > > 		.me         = THIS_MODULE,
> > > > > 	},
> > > > > +#ifdef WITH_IPV6
> > > >
> > > > I put the original order back, makes the diff smaller.
> > > > So added.
> > >
> > > Did this get merged?
> >
> > It did.  It's currently at the tip of master.
>
> Did we change repo sites?  I'm not seeing it here:
>
> https://sourceforge.net/p/xtables-addons/xtables-addons/ci/e3ae438e2e23f0849c756604a4518315e097ad62/log/?path=/extensions/xt_ECHO.c

Yes:

  https://inai.de/projects/xtables-addons/

J.
Philip Prindeville Jan. 31, 2022, 6:35 p.m. UTC | #6
> On Jan 31, 2022, at 11:31 AM, Jeremy Sowden <jeremy@azazel.net> wrote:
> 
> On 2022-01-31, at 11:27:25 -0700, Philip Prindeville wrote:
>> On Jan 31, 2022, at 3:24 AM, Jeremy Sowden <jeremy@azazel.net> wrote:
>>> On 2022-01-30, at 21:53:26 -0700, Philip Prindeville wrote:
>>>> On Sep 28, 2021, at 3:43 AM, Jan Engelhardt <jengelh@inai.de> wrote:
>>>>> [snip]
>>>> 
>>>> Did this get merged?
>>> 
>>> It did.  It's currently at the tip of master.
>> 
>> Did we change repo sites?  I'm not seeing it here:
>> 
>> https://sourceforge.net/p/xtables-addons/xtables-addons/ci/e3ae438e2e23f0849c756604a4518315e097ad62/log/?path=/extensions/xt_ECHO.c
> 
> Yes:
> 
>  https://inai.de/projects/xtables-addons/
> 
> J.


That would do it.

When is 3.19 or 4.0 due out?

Thanks,

-Philip
Jan Engelhardt Feb. 1, 2022, 5:32 p.m. UTC | #7
On Monday 2022-01-31 19:35, Philip Prindeville wrote:
>
>That would do it.
>When is 3.19 or 4.0 due out?

No particular plans, therefore I tagged 3.19 for your enjoyment.
Philip Prindeville Feb. 1, 2022, 6:22 p.m. UTC | #8
> On Feb 1, 2022, at 10:32 AM, Jan Engelhardt <jengelh@inai.de> wrote:
> 
> 
> On Monday 2022-01-31 19:35, Philip Prindeville wrote:
>> 
>> That would do it.
>> When is 3.19 or 4.0 due out?
> 
> No particular plans, therefore I tagged 3.19 for your enjoyment.


Cheers.

Rebuilding the packaging for openwrt now.
Philip Prindeville April 12, 2022, 6:18 p.m. UTC | #9
> On Feb 1, 2022, at 11:22 AM, Philip Prindeville <philipp_subx@redfish-solutions.com> wrote:
> 
> 
> 
>> On Feb 1, 2022, at 10:32 AM, Jan Engelhardt <jengelh@inai.de> wrote:
>> 
>> 
>> On Monday 2022-01-31 19:35, Philip Prindeville wrote:
>>> 
>>> That would do it.
>>> When is 3.19 or 4.0 due out?
>> 
>> No particular plans, therefore I tagged 3.19 for your enjoyment.
> 
> 
> Cheers.
> 
> Rebuilding the packaging for openwrt now.
> 


Update: stalled on getting the package maintainer for openwrt to approve my version bump PR.
diff mbox series

Patch

diff --git a/extensions/xt_ECHO.c b/extensions/xt_ECHO.c
index a0b718561db53ab468f86e17a05b5d991771d983..3c419f36f5169212af01cf62afa0b93456401767 100644
--- a/extensions/xt_ECHO.c
+++ b/extensions/xt_ECHO.c
@@ -22,7 +22,11 @@ 
 #include <net/ip6_route.h>
 #include <net/route.h>
 #include "compat_xtables.h"
+#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#	define WITH_IPV6 1
+#endif
 
+#ifdef WITH_IPV6
 static unsigned int
 echo_tg6(struct sk_buff *oldskb, const struct xt_action_param *par)
 {
@@ -124,6 +128,7 @@  echo_tg6(struct sk_buff *oldskb, const struct xt_action_param *par)
 	kfree_skb(newskb);
 	return NF_DROP;
 }
+#endif
 
 static unsigned int
 echo_tg4(struct sk_buff *oldskb, const struct xt_action_param *par)
@@ -219,21 +224,23 @@  static struct xt_target echo_tg_reg[] __read_mostly = {
 	{
 		.name       = "ECHO",
 		.revision   = 0,
-		.family     = NFPROTO_IPV6,
+		.family     = NFPROTO_IPV4,
 		.proto      = IPPROTO_UDP,
 		.table      = "filter",
-		.target     = echo_tg6,
+		.target     = echo_tg4,
 		.me         = THIS_MODULE,
 	},
+#ifdef WITH_IPV6
 	{
 		.name       = "ECHO",
 		.revision   = 0,
-		.family     = NFPROTO_IPV4,
+		.family     = NFPROTO_IPV6,
 		.proto      = IPPROTO_UDP,
 		.table      = "filter",
-		.target     = echo_tg4,
+		.target     = echo_tg6,
 		.me         = THIS_MODULE,
 	},
+#endif
 };
 
 static int __init echo_tg_init(void)
@@ -251,5 +258,7 @@  module_exit(echo_tg_exit);
 MODULE_AUTHOR("Jan Engelhardt ");
 MODULE_DESCRIPTION("Xtables: ECHO diagnosis target");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("ip6t_ECHO");
 MODULE_ALIAS("ipt_ECHO");
+#ifdef WITH_IPV6
+MODULE_ALIAS("ip6t_ECHO");
+#endif
diff --git a/extensions/xt_TARPIT.c b/extensions/xt_TARPIT.c
index 0b70dd9c8d16fe9193125b66f0773af8b00a6e81..9a7ae5cc840683d96a98ba298626b81fee355ac1 100644
--- a/extensions/xt_TARPIT.c
+++ b/extensions/xt_TARPIT.c
@@ -532,4 +532,6 @@  MODULE_DESCRIPTION("Xtables: \"TARPIT\", capture and hold TCP connections");
 MODULE_AUTHOR("Jan Engelhardt ");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ipt_TARPIT");
+#ifdef WITH_IPV6
 MODULE_ALIAS("ip6t_TARPIT");
+#endif