netifd: strip mask from IP address in DHCP client params
authorAndrey Erokhin <a.erokhin@inango-systems.com>
Tue, 7 Mar 2023 11:52:58 +0000 (16:52 +0500)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 2 Apr 2023 20:07:27 +0000 (22:07 +0200)
ipaddr option can be in CIDR notation,
but udhcp wants just an IP address

Signed-off-by: Andrey Erokhin <a.erokhin@inango-systems.com>
(cherry picked from commit 506bb436c678779e8ee54e83a7fb3e4e880037ec)

package/network/config/netifd/files/lib/netifd/proto/dhcp.sh

index ea6d872eb4926c20a8a9ab6d6468988f00363da1..636b4654ff0535ca51d9ef7e1add48150f289186 100755 (executable)
@@ -67,7 +67,7 @@ proto_dhcp_setup() {
                -p /var/run/udhcpc-$iface.pid \
                -s /lib/netifd/dhcp.script \
                -f -t 0 -i "$iface" \
-               ${ipaddr:+-r $ipaddr} \
+               ${ipaddr:+-r ${ipaddr/\/*/}} \
                ${hostname:+-x "hostname:$hostname"} \
                ${vendorid:+-V "$vendorid"} \
                $clientid $defaultreqopts $broadcast $norelease $dhcpopts