[PATCH] ipset-translate: allow invoking with a path name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Quentin Armitage <quentin@xxxxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux