| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
# Description: Remove routes to allow communication between machines which |
| 6 |
# only have an IPv4LL address assigned and those which only |
| 7 |
# have a routable address assigned. These were added by |
| 8 |
# /etc/network/if-up.d/avahi-autoipd. |
| 9 |
# |
| 10 |
# See http://developer.apple.com/qa/qa2004/qa1357.html for |
| 11 |
# more information. |
| 12 |
|
| 13 |
[ -x /usr/sbin/avahi-autoipd ] || exit 0 |
| 14 |
|
| 15 |
[ "$IFACE" != "lo" ] || exit 0 |
| 16 |
case "$ADDRFAM" in |
| 17 |
inet) ;; |
| 18 |
*) exit 0 ;; |
| 19 |
esac |
| 20 |
case "$METHOD" in |
| 21 |
static|dhcp|NetworkManager) ;; |
| 22 |
*) exit 0 ;; |
| 23 |
esac |
| 24 |
|
| 25 |
if [ -x /bin/ip ]; then |
| 26 |
# route already present? |
| 27 |
ip route show | grep -q '^169.254.0.0/16[[:space:]]' && exit 0 |
| 28 |
|
| 29 |
/bin/ip route del 169.254.0.0/16 dev $IFACE metric 1000 scope link || true |
| 30 |
elif [ -x /sbin/route ]; then |
| 31 |
# route already present? |
| 32 |
/sbin/route -n | grep -q "^169.254.0.0[[:space:]]" && exit 0 |
| 33 |
|
| 34 |
/sbin/route del -net 169.254.0.0 netmask 255.255.0.0 dev $IFACE metric 1000 || true |
| 35 |
fi |
| 36 |
|