diff --git a/etc/network/if-post-down.d/ifenslave b/etc/network/if-post-down.d/ifenslave
index e972940..a192ca5 100755
--- a/etc/network/if-post-down.d/ifenslave
+++ b/etc/network/if-post-down.d/ifenslave
@@ -2,6 +2,8 @@
[ "$VERBOSITY" = 1 ] && set -x
+[ "$ADDRFAM" = meta ] && exit 0
+
sysfs()
{
# Called with :
@@ -25,7 +27,6 @@ sysfs_remove_all()
}
BOND_PARAMS="/sys/class/net/$IFACE/bonding"
-IFSTATE=/etc/network/run/ifstate
# free $IFACE if it is currently enslaved to a bonding device.
if [ -f "/sys/class/net/$IFACE/master/bonding/slaves" ] ; then
@@ -53,9 +54,8 @@ sysfs_remove_all arp_ip_target
[ "$VERBOSITY" = 1 ] && v=-v
read slaves < "$BOND_PARAMS/slaves"
for slave in $slaves ; do
- # If $slave is currently up in $IFSTATE, then bring it down, to keep $IFSTATE consistent.
# This is supposed to have the side effect of freeing the interface.
- grep -q "^$slave=" $IFSTATE && ifdown $v $slave
+ ifquery --state $slave && ifdown $v $slave
# Anyway, ensure $slave is free.
if [ -f "/sys/class/net/$slave/master/bonding/slaves" ] ; then
diff --git a/etc/network/if-pre-up.d/ifenslave b/etc/network/if-pre-up.d/ifenslave
index 439204f..a545f10 100755
--- a/etc/network/if-pre-up.d/ifenslave
+++ b/etc/network/if-pre-up.d/ifenslave
@@ -2,7 +2,7 @@
[ "$VERBOSITY" = 1 ] && set -x
-IFSTATE=/etc/network/run/ifstate
+[ "$ADDRFAM" = meta ] && exit 0
add_master()
{
@@ -89,7 +89,7 @@ enslave_slaves()
[ "$VERBOSITY" = 1 ] && v=-v
for slave in $BOND_SLAVES ; do
- if ( [ "$AUTOIF" ] && grep -q "^$slave=" $IFSTATE ) ; then
+ if ( [ "$AUTOIF" ] && ifquery --state $slave ) ; then
echo "Not enslaving interface $slave since it is already configured"
else
# Ensure $slave is down.
diff --git a/etc/network/if-up.d/ifenslave b/etc/network/if-up.d/ifenslave
index 8757d97..4d83751 100755
--- a/etc/network/if-up.d/ifenslave
+++ b/etc/network/if-up.d/ifenslave
@@ -2,6 +2,8 @@
[ "$VERBOSITY" = 1 ] && set -x
+[ "$ADDRFAM" = meta ] && exit 0
+
sysfs()
{
# Called with :