summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-21 16:40:44 -0700
committerBen Pfaff <blp@nicira.com>2011-06-21 16:40:44 -0700
commitb3a375f242c70ff85c30f84ce311628de4a6f022 (patch)
treec1175ca7ada5dbd515797c0b3a88dd225e7fd017 /debian
parentbb9f6963579816c0209a2a7d5510689a043dd965 (diff)
downloadopenvswitch-b3a375f242c70ff85c30f84ce311628de4a6f022.tar.gz
Avoid inserting duplicate iptables rules when restarting vswitch.
On startup, some OVS initscripts insert an iptables rule to allow GRE traffic (because GRE support is an important OVS feature). I noticed that, each time I restarted OVS, this added another GRE-related rule to the iptables chain. This is wasteful, because each additional rule increases the time it takes to process a packet in the IP stack. This commit avoids the problem by inserting an iptables rule when there isn't already an appropriate rule. It also avoids inserting an iptables rule if the iptables policy is ACCEPT, meaning that packets are accepted by default; in such a case, if the GRE packet would be dropped, it is because the system administrator made that decision explicitly. Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/openvswitch-switch.init6
1 files changed, 2 insertions, 4 deletions
diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init
index a65af0ce1..36bc20891 100755
--- a/debian/openvswitch-switch.init
+++ b/debian/openvswitch-switch.init
@@ -34,11 +34,9 @@ start () {
if test X"$FORCE_COREFILES" != X; then
set "$@" --force-corefiles="$FORCE_COREFILES"
fi
+ "$@" || exit $?
- # Allow GRE traffic.
- test ! -x /sbin/iptables || /sbin/iptables -I INPUT -p gre -j ACCEPT
-
- "$@"
+ $ovs_ctl --protocol=gre enable-protocol
}
stop () {