package: replace remaining occurrences of ifconfig with ip
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 30 Jul 2020 15:25:21 +0000 (17:25 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 3 Aug 2020 08:42:35 +0000 (10:42 +0200)
ifconfig is effectively deprecated for quite some time now. Let's
replace the remaining occurrences for packages by the
corresponding ip commands now.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
package/network/config/netifd/files/usr/share/udhcpc/default.script
package/network/config/qos-scripts/files/usr/lib/qos/generate.sh

index ac765a6363b09cbf0bd8b0f529455ff42c77412d..0a9eb0180e47f7104e33b7557411d1b6966a10d4 100755 (executable)
@@ -14,8 +14,8 @@ set_classless_routes() {
 }
 
 setup_interface() {
-       echo "udhcpc: ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}"
-       ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}
+       echo "udhcpc: ip addr add $ip/${subnet:-255.255.255.0} broadcast ${broadcast:-+} dev $interface"
+       ip addr add $ip/${subnet:-255.255.255.0} broadcast ${broadcast:-+} dev $interface
 
        [ -n "$router" ] && [ "$router" != "0.0.0.0" ] && [ "$router" != "255.255.255.255" ] && {
                echo "udhcpc: setting default routers: $router"
@@ -41,7 +41,7 @@ setup_interface() {
 applied=
 case "$1" in
        deconfig)
-               ifconfig "$interface" 0.0.0.0
+               ip -4 addr flush dev "$interface"
        ;;
        renew)
                setup_interface update
index 024be0c1704a1297442a4106123e8529956a5a44..32f15581f843658a94e9f4cb45873ddbff976d55 100755 (executable)
@@ -326,7 +326,7 @@ start_interface() {
                        append cstr "$classnr:$prio:$avgrate:$pktsize:$pktdelay:$maxrate:$qdisc:$filter" "$N"
                done
                append ${prefix}q "$(tcrules)" "$N"
-               export dev_${dir}="ifconfig $dev up >&- 2>&-
+               export dev_${dir}="ip link set $dev up >&- 2>&-
 tc qdisc del dev $dev root >&- 2>&-
 tc qdisc add dev $dev root handle 1: hfsc default ${class_default}0
 tc class add dev $dev parent 1: classid 1:1 hfsc sc rate ${rate}kbit ul rate ${rate}kbit"