forked from pool/ipset
Jan Engelhardt
e1671d6ac6
- Add ipset-file.diff [boo#1116432]. OBS-URL: https://build.opensuse.org/request/show/650550 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/ipset?expand=0&rev=79
40 lines
1.1 KiB
Diff
40 lines
1.1 KiB
Diff
From a680d3fdbb637fae53c60e4a30f028bd5ed1fe4b Mon Sep 17 00:00:00 2001
|
|
From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
|
|
Date: Sat, 10 Nov 2018 17:34:57 +0100
|
|
Subject: Fix to list/save into file specified by option
|
|
|
|
list/save into file given by "-f filename" did not work in 7.0,
|
|
reported by Isaac Good.
|
|
---
|
|
lib/ipset.c | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/lib/ipset.c b/lib/ipset.c
|
|
index 8d05b39..4366e60 100644
|
|
--- a/lib/ipset.c
|
|
+++ b/lib/ipset.c
|
|
@@ -633,7 +633,7 @@ restore(struct ipset *ipset)
|
|
if (ipset->filename) {
|
|
ret = ipset_session_io_normal(session, ipset->filename,
|
|
IPSET_IO_INPUT);
|
|
- if (ret)
|
|
+ if (ret < 0)
|
|
return ret;
|
|
f = ipset_session_io_stream(session, IPSET_IO_INPUT);
|
|
}
|
|
@@ -1204,9 +1204,10 @@ ipset_parse_argv(struct ipset *ipset, int oargc, char *oargv[])
|
|
if (ipset->filename != NULL) {
|
|
ret = ipset_session_io_normal(session,
|
|
ipset->filename, IPSET_IO_OUTPUT);
|
|
- if (!ret)
|
|
+ if (ret < 0)
|
|
return ret;
|
|
}
|
|
+ /* Fall through to parse optional setname */
|
|
case IPSET_CMD_DESTROY:
|
|
case IPSET_CMD_FLUSH:
|
|
/* Args: [setname] */
|
|
--
|
|
cgit v1.2.1
|
|
|