Just enable this behaviour by default in the ip command stub, since
10.interface assumes/sets it. The rc.local replacement for set_proc()
doesn't do anything...
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
sys/net/ipv4/conf/all/arp_filter)
echo 1
;;
+ sys/net/ipv4/conf/all/promote_secondaries)
+ echo 1
+ ;;
fs/nfsd/threads)
echo "$FAKE_NFSD_THREAD_PIDS" | wc -w
;;
#!/bin/sh
+promote_secondaries=true
+
not_implemented ()
{
echo "ip stub command: \"$1\" not implemented"
echo "RTNETLINK answers: Cannot assign requested address" >&2
exit 254
elif grep -Fq "$local" "$pf" ; then
- # Remove primaries AND SECONDARIES.
- rm -f "$pf" "$sf"
+ if $promote_secondaries && [ -s "$sf" ] ; then
+ head -n 1 "$sf" >"$pf"
+ sed -i -e '1d' "$sf"
+ else
+ # Remove primaries AND SECONDARIES.
+ rm -f "$pf" "$sf"
+ fi
elif [ -f "$sf" ] && grep -Fq "$local" "$sf" ; then
grep -Fv "$local" "$sf" >"${sf}.new"
mv "${sf}.new" "$sf"