[2/2] firewall-lib.pl: Remove prefix when dealing with ipset sets.

Message ID 20220302194306.4110-2-stefan.schantl@ipfire.org
State Accepted
Commit 96e2e870aa807d897ddc7b6019ac1574e38633d8
Headers
Series [1/2] rules.pl: Autodetect ipset db file to restore. |

Commit Message

Stefan Schantl March 2, 2022, 7:43 p.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/firewall/firewall-lib.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer March 3, 2022, 3:10 p.m. UTC | #1
Hello Stefan,

Thank you for this patch. It is however already obsolete due to my changes to libloc:

  https://lists.ipfire.org/pipermail/location/2022-March/000536.html

Could you please send some follow-up patches that update this to the latest naming convention?

Would you also take care of packaging libloc for IPFire 2?

Best,
-Michael

> On 2 Mar 2022, at 19:43, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
> config/firewall/firewall-lib.pl | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/config/firewall/firewall-lib.pl b/config/firewall/firewall-lib.pl
> index f4089a3a0..7d35d5686 100644
> --- a/config/firewall/firewall-lib.pl
> +++ b/config/firewall/firewall-lib.pl
> @@ -466,7 +466,7 @@ sub get_address
> 			# Get external interface.
> 			my $external_interface = &get_external_interface();
> 
> -			push(@ret, ["-m set --match-set CC_$value src", "$external_interface"]);
> +			push(@ret, ["-m set --match-set $value src", "$external_interface"]);
> 		}
> 
> 	# Handle rule options with a location as target.
> @@ -476,7 +476,7 @@ sub get_address
> 			# Get external interface.
> 			my $external_interface = &get_external_interface();
> 
> -			push(@ret, ["-m set --match-set CC_$value dst", "$external_interface"]);
> +			push(@ret, ["-m set --match-set $value dst", "$external_interface"]);
> 		}
> 
> 	# If nothing was selected, we assume "any".
> -- 
> 2.30.2
>
  

Patch

diff --git a/config/firewall/firewall-lib.pl b/config/firewall/firewall-lib.pl
index f4089a3a0..7d35d5686 100644
--- a/config/firewall/firewall-lib.pl
+++ b/config/firewall/firewall-lib.pl
@@ -466,7 +466,7 @@  sub get_address
 			# Get external interface.
 			my $external_interface = &get_external_interface();
 
-			push(@ret, ["-m set --match-set CC_$value src", "$external_interface"]);
+			push(@ret, ["-m set --match-set $value src", "$external_interface"]);
 		}
 
 	# Handle rule options with a location as target.
@@ -476,7 +476,7 @@  sub get_address
 			# Get external interface.
 			my $external_interface = &get_external_interface();
 
-			push(@ret, ["-m set --match-set CC_$value dst", "$external_interface"]);
+			push(@ret, ["-m set --match-set $value dst", "$external_interface"]);
 		}
 
 	# If nothing was selected, we assume "any".