this stuff is just so fragile that it will enter infinite recovery and fail loops
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 10 Nov 2010 03:45:43 +0000 (14:45 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 10 Nov 2010 03:55:25 +0000 (14:55 +1100)
on any kind of tiny unexpected error

unconditionally try to remove ip addresses from both old and new interface
before trying to add it to the new interface to make it less
fragile

config/events.d/10.interface

index 5b31fb81090e2e586f3dc745aac6e3cc814a8d98..640d3dbad3bffe190b0ecb34ae2bcf800d42f43b 100755 (executable)
@@ -244,11 +244,8 @@ case "$1" in
        iptables -D INPUT -i $oiface -d $ip -j DROP 2> /dev/null
        iptables -I INPUT -i $oiface -d $ip -j DROP
 
-       delete_ip_from_iface $oiface $ip $maskbits || {
-               delete_ip_from_iface $niface $ip $maskbits
-               iptables -D INPUT -i $oiface -d $ip -j DROP 2> /dev/null
-               exit 1;
-       }
+       delete_ip_from_iface $oiface $ip $maskbits 2>/dev/null
+       delete_ip_from_iface $niface $ip $maskbits 2>/dev/null
 
        add_ip_to_iface $niface $ip $maskbits || {
                iptables -D INPUT -i $oiface -d $ip -j DROP 2> /dev/null