Permalink
Browse files

FL-428: unfork iptables

  • Loading branch information...
1 parent e6415e1 commit c480afaeccebac782a5c15f95544f6bd9784de71 @angryvincent angryvincent committed Mar 1, 2013
@@ -1,3 +0,0 @@
-DIST iptables-1.4.12.1.tar.bz2 473418 RMD160 286d27b6fc7d47fb1a47f4434d7accdef39f1f1a SHA1 86022c3b5129ad7105f5087ec1349e99cc5a9728 SHA256 77e6581f21f15946a814fa311236e5f3f7c6593180f9d695cea06aa95e464aba
-DIST iptables-1.4.13.tar.bz2 502942 RMD160 ec900ff3d4e57808efb3f0a1a3bd906e6f9bc8d8 SHA1 bf1f1896e052d1813a7c96fa70f88be8dab3ff86 SHA256 321e2600fc4541a958e44cafd85a42864b0035404097e0f2e082d474029b9ded
-DIST iptables-1.4.15.tar.bz2 514830 RMD160 e753d36ba4aba34034c902fbeff73af3537d9f15 SHA1 56ab3b143af2ad443c9652db3a38ef8869cd2207 SHA256 867c144e60075e7bebe6fcecf0b65169d5e2d1fa5ceec2ebd9780cd5026123ea
@@ -1,11 +0,0 @@
-# /etc/conf.d/ip6tables
-
-# Location in which iptables initscript will save set rules on
-# service shutdown
-IP6TABLES_SAVE="/var/lib/ip6tables/rules-save"
-
-# Options to pass to iptables-save and iptables-restore
-SAVE_RESTORE_OPTIONS="-c"
-
-# Save state on stopping iptables
-SAVE_ON_STOP="yes"
@@ -1,19 +0,0 @@
-# /etc/conf.d/ip6tables
-
-# Location in which iptables initscript will save set rules on
-# service shutdown
-IP6TABLES_SAVE="/var/lib/ip6tables/rules-save"
-
-# Options to pass to iptables-save and iptables-restore
-SAVE_RESTORE_OPTIONS="-c"
-
-# Save state on stopping iptables
-SAVE_ON_STOP="yes"
-
-# If you need to log iptables messages as soon as iptables starts,
-# AND your logger does NOT depend on the network, then you may wish
-# to uncomment the next line.
-# If your logger depends on the network, and you uncomment this line
-# you will create an unresolvable circular dependency during startup.
-# After commenting or uncommenting this line, you must run 'rc-update -u'.
-#rc_use="logger"
@@ -1,11 +0,0 @@
-# /etc/conf.d/iptables
-
-# Location in which iptables initscript will save set rules on
-# service shutdown
-IPTABLES_SAVE="/var/lib/iptables/rules-save"
-
-# Options to pass to iptables-save and iptables-restore
-SAVE_RESTORE_OPTIONS="-c"
-
-# Save state on stopping iptables
-SAVE_ON_STOP="yes"
@@ -1,115 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/iptables/files/iptables-1.3.2.init,v 1.7 2011/12/04 10:15:59 swegener Exp $
-
-extra_commands="save panic"
-extra_started_commands="reload"
-
-iptables_name=${SVCNAME}
-if [ "${iptables_name}" != "iptables" -a "${iptables_name}" != "ip6tables" ] ; then
- iptables_name="iptables"
-fi
-
-iptables_bin="/sbin/${iptables_name}"
-case ${iptables_name} in
- iptables) iptables_proc="/proc/net/ip_tables_names"
- iptables_save=${IPTABLES_SAVE};;
- ip6tables) iptables_proc="/proc/net/ip6_tables_names"
- iptables_save=${IP6TABLES_SAVE};;
-esac
-
-depend() {
- before net
- use logger
-}
-
-set_table_policy() {
- local chains table=$1 policy=$2
- case ${table} in
- nat) chains="PREROUTING POSTROUTING OUTPUT";;
- mangle) chains="PREROUTING INPUT FORWARD OUTPUT POSTROUTING";;
- filter) chains="INPUT FORWARD OUTPUT";;
- *) chains="";;
- esac
- local chain
- for chain in ${chains} ; do
- ${iptables_bin} -t ${table} -P ${chain} ${policy}
- done
-}
-
-checkkernel() {
- if [ ! -e ${iptables_proc} ] ; then
- eerror "Your kernel lacks ${iptables_name} support, please load"
- eerror "appropriate modules and try again."
- return 1
- fi
- return 0
-}
-checkconfig() {
- if [ ! -f ${iptables_save} ] ; then
- eerror "Not starting ${iptables_name}. First create some rules then run:"
- eerror "/etc/init.d/${iptables_name} save"
- return 1
- fi
- return 0
-}
-
-start() {
- checkconfig || return 1
- ebegin "Loading ${iptables_name} state and starting firewall"
- ${iptables_bin}-restore ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
- eend $?
-}
-
-stop() {
- if [ "${SAVE_ON_STOP}" = "yes" ] ; then
- save || return 1
- fi
- checkkernel || return 1
- ebegin "Stopping firewall"
- local a
- for a in $(cat ${iptables_proc}) ; do
- set_table_policy $a ACCEPT
-
- ${iptables_bin} -F -t $a
- ${iptables_bin} -X -t $a
- done
- eend $?
-}
-
-reload() {
- checkkernel || return 1
- ebegin "Flushing firewall"
- local a
- for a in $(cat ${iptables_proc}) ; do
- ${iptables_bin} -F -t $a
- ${iptables_bin} -X -t $a
- done
- eend $?
-
- start
-}
-
-save() {
- ebegin "Saving ${iptables_name} state"
- touch "${iptables_save}"
- chmod 0600 "${iptables_save}"
- ${iptables_bin}-save ${SAVE_RESTORE_OPTIONS} > "${iptables_save}"
- eend $?
-}
-
-panic() {
- checkkernel || return 1
- service_started ${iptables_name} && svc_stop
-
- local a
- ebegin "Dropping all packets"
- for a in $(cat ${iptables_proc}) ; do
- ${iptables_bin} -F -t $a
- ${iptables_bin} -X -t $a
-
- set_table_policy $a DROP
- done
- eend $?
-}
@@ -1,17 +0,0 @@
-diff --git a/iptables/Makefile.am b/iptables/Makefile.am
-index 13cca9c..a068278 100644
---- a/iptables/Makefile.am
-+++ b/iptables/Makefile.am
-@@ -51,10 +51,10 @@ v6_sbin_links = ip6tables ip6tables-restore ip6tables-save
- endif
-
- iptables.8: ${srcdir}/iptables.8.in ../extensions/matches4.man ../extensions/targets4.man
-- ${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' -e '/@MATCH@/ r extensions/matches4.man' -e '/@TARGET@/ r extensions/targets4.man' $< >$@;
-+ ${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' -e '/@MATCH@/ r ../extensions/matches4.man' -e '/@TARGET@/ r ../extensions/targets4.man' $< >$@;
-
- ip6tables.8: ${srcdir}/ip6tables.8.in ../extensions/matches6.man ../extensions/targets6.man
-- ${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' -e '/@MATCH@/ r extensions/matches6.man' -e '/@TARGET@/ r extensions/targets6.man' $< >$@;
-+ ${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' -e '/@MATCH@/ r ../extensions/matches6.man' -e '/@TARGET@/ r ../extensions/targets6.man' $< >$@;
-
- pkgconfig_DATA = xtables.pc
-
@@ -1,117 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/iptables/files/iptables-1.4.11.init,v 1.2 2011/12/04 10:15:59 swegener Exp $
-
-extra_commands="save panic"
-extra_started_commands="reload"
-
-iptables_name=${SVCNAME}
-if [ "${iptables_name}" != "iptables" -a "${iptables_name}" != "ip6tables" ] ; then
- iptables_name="iptables"
-fi
-
-iptables_bin="/sbin/${iptables_name}"
-case ${iptables_name} in
- iptables) iptables_proc="/proc/net/ip_tables_names"
- iptables_save=${IPTABLES_SAVE};;
- ip6tables) iptables_proc="/proc/net/ip6_tables_names"
- iptables_save=${IP6TABLES_SAVE};;
-esac
-
-depend() {
- before net
- use logger
-}
-
-set_table_policy() {
- local chains table=$1 policy=$2
- case ${table} in
- nat) chains="PREROUTING POSTROUTING OUTPUT";;
- mangle) chains="PREROUTING INPUT FORWARD OUTPUT POSTROUTING";;
- filter) chains="INPUT FORWARD OUTPUT";;
- *) chains="";;
- esac
- local chain
- for chain in ${chains} ; do
- ${iptables_bin} -t ${table} -P ${chain} ${policy}
- done
-}
-
-checkkernel() {
- if [ ! -e ${iptables_proc} ] ; then
- eerror "Your kernel lacks ${iptables_name} support, please load"
- eerror "appropriate modules and try again."
- return 1
- fi
- return 0
-}
-checkconfig() {
- if [ ! -f ${iptables_save} ] ; then
- eerror "Not starting ${iptables_name}. First create some rules then run:"
- eerror "/etc/init.d/${iptables_name} save"
- return 1
- fi
- return 0
-}
-
-start() {
- checkconfig || return 1
- ebegin "Loading ${iptables_name} state and starting firewall"
- ${iptables_bin}-restore ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
- eend $?
-}
-
-stop() {
- if [ "${SAVE_ON_STOP}" = "yes" ] ; then
- save || return 1
- fi
- checkkernel || return 1
- ebegin "Stopping firewall"
- local a
- for a in $(cat ${iptables_proc}) ; do
- set_table_policy $a ACCEPT
-
- ${iptables_bin} -F -t $a
- ${iptables_bin} -X -t $a
- done
- eend $?
-}
-
-reload() {
- checkkernel || return 1
- ebegin "Flushing firewall"
- local a
- for a in $(cat ${iptables_proc}) ; do
- ${iptables_bin} -F -t $a
- ${iptables_bin} -X -t $a
- done
- eend $?
-
- start
-}
-
-save() {
- ebegin "Saving ${iptables_name} state"
- touch "${iptables_save}"
- chmod 0600 "${iptables_save}"
- ${iptables_bin}-save ${SAVE_RESTORE_OPTIONS} > "${iptables_save}"
- eend $?
-}
-
-panic() {
- checkkernel || return 1
- if service_started ${iptables_name}; then
- rc-service ${iptables_name} stop
- fi
-
- local a
- ebegin "Dropping all packets"
- for a in $(cat ${iptables_proc}) ; do
- ${iptables_bin} -F -t $a
- ${iptables_bin} -X -t $a
-
- set_table_policy $a DROP
- done
- eend $?
-}
@@ -1,48 +0,0 @@
-commit 3412bd0bfb8b8bac9834cbfd3392b3d5487133bf
-Author: Tom Eastep <teastep@shorewall.net>
-Date: Thu Aug 18 15:11:16 2011 -0700
-
- libxt_conntrack: improve error message on parsing violation
-
- Tom Eastep noted:
-
- $ iptables -A foo -m conntrack --ctorigdstport 22
- iptables v1.4.12: conntrack rev 2 does not support port ranges
- Try `iptables -h' or 'iptables --help' for more information.
-
- Commit v1.4.12-41-g1ad6407 takes care of the actual cause of the bug,
- but let's include Tom's patch nevertheless for the better error
- message in case one actually does specify a range with rev 2.
-
- References: http://marc.info/?l=netfilter-devel&m=131370592105298&w=2
- Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-
-diff --git a/extensions/libxt_conntrack.c b/extensions/libxt_conntrack.c
-index 060b947..fff69f8 100644
---- a/extensions/libxt_conntrack.c
-+++ b/extensions/libxt_conntrack.c
-@@ -129,13 +129,20 @@ static const struct xt_option_entry conntrack2_mt_opts[] = {
- .flags = XTOPT_INVERT},
- {.name = "ctexpire", .id = O_CTEXPIRE, .type = XTTYPE_UINT32RC,
- .flags = XTOPT_INVERT},
-- {.name = "ctorigsrcport", .id = O_CTORIGSRCPORT, .type = XTTYPE_PORT,
-+ /*
-+ * Rev 1 and 2 only store one port, and we would normally use
-+ * %XTTYPE_PORT (rather than %XTTYPE_PORTRC) for that. The resulting
-+ * error message - in case a user passed a range nevertheless -
-+ * "port 22:23 resolved to nothing" is not quite as useful as using
-+ * %XTTYPE_PORTC and libxt_conntrack's own range test.
-+ */
-+ {.name = "ctorigsrcport", .id = O_CTORIGSRCPORT, .type = XTTYPE_PORTRC,
- .flags = XTOPT_INVERT | XTOPT_NBO},
-- {.name = "ctorigdstport", .id = O_CTORIGDSTPORT, .type = XTTYPE_PORT,
-+ {.name = "ctorigdstport", .id = O_CTORIGDSTPORT, .type = XTTYPE_PORTRC,
- .flags = XTOPT_INVERT | XTOPT_NBO},
-- {.name = "ctreplsrcport", .id = O_CTREPLSRCPORT, .type = XTTYPE_PORT,
-+ {.name = "ctreplsrcport", .id = O_CTREPLSRCPORT, .type = XTTYPE_PORTRC,
- .flags = XTOPT_INVERT | XTOPT_NBO},
-- {.name = "ctrepldstport", .id = O_CTREPLDSTPORT, .type = XTTYPE_PORT,
-+ {.name = "ctrepldstport", .id = O_CTREPLDSTPORT, .type = XTTYPE_PORTRC,
- .flags = XTOPT_INVERT | XTOPT_NBO},
- {.name = "ctdir", .id = O_CTDIR, .type = XTTYPE_STRING},
- XTOPT_TABLEEND,
Oops, something went wrong.

0 comments on commit c480afa

Please sign in to comment.