netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipset-translate: allow invoking with a path name
@ 2022-08-11 16:52 Quentin Armitage
  2022-08-16 21:40 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Quentin Armitage @ 2022-08-11 16:52 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Quentin Armitage

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
---
 src/ipset.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/ipset.c b/src/ipset.c
index 6d42b60..e53ffb1 100644
--- a/src/ipset.c
+++ b/src/ipset.c
@@ -6,6 +6,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#define _GNU_SOURCE
+
 #include <assert.h>			/* assert */
 #include <stdio.h>			/* fprintf */
 #include <stdlib.h>			/* exit */
@@ -31,7 +33,7 @@ main(int argc, char *argv[])
 		exit(1);
 	}
 
-	if (!strcmp(argv[0], "ipset-translate")) {
+	if (!strcmp(basename(argv[0]), "ipset-translate")) {
 		ret = ipset_xlate_argv(ipset, argc, argv);
 	} else {
 		ret = ipset_parse_argv(ipset, argc, argv);
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipset-translate: allow invoking with a path name
  2022-08-11 16:52 [PATCH] ipset-translate: allow invoking with a path name Quentin Armitage
@ 2022-08-16 21:40 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2022-08-16 21:40 UTC (permalink / raw)
  To: Quentin Armitage; +Cc: netfilter-devel, Jozsef Kadlecsik

Applied, thanks.

On Thu, Aug 11, 2022 at 05:52:18PM +0100, Quentin Armitage wrote:
> Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
> ---
>  src/ipset.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/ipset.c b/src/ipset.c
> index 6d42b60..e53ffb1 100644
> --- a/src/ipset.c
> +++ b/src/ipset.c
> @@ -6,6 +6,8 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   */
> +#define _GNU_SOURCE
> +
>  #include <assert.h>			/* assert */
>  #include <stdio.h>			/* fprintf */
>  #include <stdlib.h>			/* exit */
> @@ -31,7 +33,7 @@ main(int argc, char *argv[])
>  		exit(1);
>  	}
>  
> -	if (!strcmp(argv[0], "ipset-translate")) {
> +	if (!strcmp(basename(argv[0]), "ipset-translate")) {
>  		ret = ipset_xlate_argv(ipset, argc, argv);
>  	} else {
>  		ret = ipset_parse_argv(ipset, argc, argv);
> -- 
> 2.34.3
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-16 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-11 16:52 [PATCH] ipset-translate: allow invoking with a path name Quentin Armitage
2022-08-16 21:40 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).