I've this script which checks for a veth-pair and setup an ifb device on it, but everytime it says cannot find free ifb device for that particular veth pair.
What could be the problem? Even I tried running modprobe
command which by default creates two ifb
, then also it throws the same error.
#return 0 if the ifb is free
check_ifb()
{
local installed=`nl-qdisc-list -d $1`
[ -n "$installed" ] && return 1
return 0
}
setup_ifb()
{
for ifb in `ifconfig -a -s|egrep ^ifb|cut -d ' ' -f1`
do
check_ifb "$ifb" || continue
IFB="$ifb"
break
done
if [ -z "IFB" ]
then
echo "Unable to find a free ifb device for $vifname"
exit -1
fi
ip link set dev "IFB" up
if [ $? -ne 0 ]
then
echo ip link set dev "IFB" up failed
exit -1
fi
}