/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to network-hooks.d/bridge

* network-hooks.d/bridge: Bug fixes: Ignore bridge interface when
                          looking up interface name by hw address.
                          Say we need "/sbin/brctl" even if it does
                          not exist.  Sleep only integer seconds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
addrtoif(){
22
22
    grep -liFe "$1" /sys/class/net/*/address \
23
 
        | sed -e 's,.*/\([^/]*\)/[^/]*,\1,'
 
23
        | sed -e 's,.*/\([^/]*\)/[^/]*,\1,' -e "/^${BRIDGE}\$/d"
24
24
}
25
25
 
26
26
# Read config file, which must set "BRIDGE", "PORT_ADDRESSES", and
37
37
    exit
38
38
fi
39
39
 
40
 
for b in /sbin/brctl /usr/sbin/brctl; do
 
40
brctl="/sbin/brctl"
 
41
for b in "$brctl" /usr/sbin/brctl; do
41
42
    if [ -e "$b" ]; then
42
43
        brctl="$b"
43
44
        break
53
54
            ip link set dev "$interface" up
54
55
        done
55
56
        ip link set dev "$BRIDGE" up
56
 
        sleep "$DELAY"
 
57
        sleep "${DELAY%%.*}"
57
58
        if [ -n "$IPADDRS" ]; then
58
59
            for ipaddr in $IPADDRS; do
59
60
                ip addr add "$ipaddr" dev "$BRIDGE"