~ubuntu-branches/ubuntu/hardy/ufw/hardy-updates

« back to all changes in this revision

Viewing changes to conf/initscript

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2008-07-11 18:37:27 UTC
  • Revision ID: james.westby@ubuntu.com-20080711183727-l26fstr6mooy4rqp
Tags: 0.16.2.3
* fix confusing error output when ipv6 or ip6_tables is not available.
  (LP: #194844)
* fix initscript not setting default ipv6 policy when IPV6=no (LP: #251355)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        done
47
47
 
48
48
        execs="iptables"
 
49
 
 
50
        # IPv6 setup
49
51
        if [ "$IPV6" = "yes" ] || [ "$IPV6" = "YES" ]; then
50
 
            if [ -e "/proc/sys/net/ipv6" ]; then
51
 
                execs="$execs ip6tables"
52
 
            elif modprobe ipv6 ; then
 
52
            if ip6tables -L INPUT >/dev/null 2>&1; then
53
53
                execs="$execs ip6tables"
54
54
            else
55
55
                log_action_cont_msg "Problem loading ipv6 (skipping)"
56
56
            fi
 
57
        else
 
58
            if ip6tables -L INPUT >/dev/null 2>&1; then
 
59
                # IPv6 support disabled but available in the kernel, so
 
60
                # default DROP and accept all on loopback
 
61
                ip6tables -F || error="yes"
 
62
                ip6tables -X || error="yes"
 
63
                ip6tables -P INPUT DROP || error="yes"
 
64
                ip6tables -P OUTPUT DROP || error="yes"
 
65
                ip6tables -P FORWARD DROP || error="yes"
 
66
                ip6tables -A INPUT -i lo -j ACCEPT || error="yes"
 
67
                ip6tables -A OUTPUT -o lo -j ACCEPT || error="yes"
 
68
                if [ "$error" = "yes" ]; then
 
69
                    log_action_cont_msg "Problem setting default IPv6 policy"
 
70
                fi
 
71
            fi
57
72
        fi
58
73
 
59
74
        for exe in $execs
116
131
            $exe -A ufw${type}-before-input -j RETURN || error="yes"
117
132
            $exe -A ufw${type}-before-output -j RETURN || error="yes"
118
133
            $exe -A ufw${type}-before-forward -j RETURN || error="yes"
119
 
        
 
134
 
120
135
            # setup ufw${type}-after-* chains
121
136
            $exe -N ufw${type}-after-input || error="yes"
122
137
            $exe -N ufw${type}-after-output || error="yes"
157
172
    error=""
158
173
 
159
174
    execs="iptables"
160
 
    if [ -e "/proc/sys/net/ipv6" ]; then
 
175
    if ip6tables -L INPUT >/dev/null 2>&1; then
161
176
        execs="$execs ip6tables"
162
177
    fi
163
178