summaryrefslogtreecommitdiffstats
path: root/iptables/iptables-save.c
Commit message (Collapse)AuthorAgeFilesLines
* iptables: Add file output option to iptables-saveOliver Ford2017-05-291-2/+20
| | | | | | | | | | | | | | | Adds an option to output the results of iptables-save, ip6tables-save, and xtables-save save to a file. Updates the man page with this new option. Uses the dup2 call to replace stdout with the specified file. Error output is unchanged. This is a feature requested by a Gentoo developer in Bugzilla #905. Signed-off-by: Oliver Ford <ojford@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* iptables-restore/save: exit when given an unknown optionVincent Bernat2017-04-191-0/+4
| | | | | | | | | | | | When an unknown option is given, iptables-restore should exit instead of continue its operation. For example, if `--table` was misspelled, this could lead to an unwanted change. Moreover, exit with a status code of 1. Make the same change for iptables-save. OTOH, exit with a status code of 0 when requesting help. Signed-off-by: Vincent Bernat <vincent@bernat.im> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* iptables: Remove explicit static variables initalization.Varsha Rao2017-04-061-1/+1
| | | | | | | | Static variables are initialized to zero by default, so remove explicit initalization. This patch fixes the checkpatch issue. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* iptables-save: exit with error if unable to open proc fileThomas Habets2017-01-181-4/+10
| | | | Signed-off-by: Florian Westphal <fw@strlen.de>
* consistently use <errno.h>Felix Janda2015-05-021-1/+1
| | | | | | | | | On glibc, <sys/errno.h> is a synomym for <errno.h>. <errno.h> is specified by POSIX, so use that. Fixes compilation error with musl libc Signed-off-by: Florian Westphal <fw@strlen.de>
* iptables-save: actually parse -M/--modprobe optionJiri Popelka2014-03-171-1/+1
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* iptables-{save,restore}: warn that -b/--binary isn't implementedJiri Popelka2014-03-171-0/+3
| | | | | | see also 296dca39be Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* iptables-save: remove dlfcn.h includeGustavo Zacarias2013-11-281-4/+0
| | | | | | | | It's not required and breaks on static-only uClibc builds which don't have the header file. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Florian Westphal <fw@strlen.de>
* src: resolve old macro names that are indirectionsJan Engelhardt2011-09-111-2/+2
| | | | | | | | | | | Command used: git grep -f <(pcregrep -hior '(?<=#define\s)IP6?(T_\w+)(?=\s+X\1)' include/) and then fix all occurrences. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* libiptc: combine common types: _handleJan Engelhardt2011-09-111-1/+1
| | | | | | | No real API/ABI change incurred, since the definition of the structs' types is not visible anyhow. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* iptables-save: remove binary dumping dead codeJan Engelhardt2011-09-111-46/+34
| | | | | | Was never implemented, kill it. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* src: remove unused IPTABLES_MULTI defineJan Engelhardt2011-08-261-5/+0
| | | | | | This dead code has been lingering around since commit v1.4.5~7. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* src: move all iptables pieces into a separate directoryJan Engelhardt2011-06-071-0/+185
(Unclutter top-level dir) Signed-off-by: Jan Engelhardt <jengelh@medozas.de>