From: Andrey Erokhin Date: Tue, 7 Mar 2023 11:52:58 +0000 (+0500) Subject: netifd: strip mask from IP address in DHCP client params X-Git-Tag: v6.0-20240103~29 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e0860724dd035a345106ad00cdb5c0c2c83eac90;p=librecmc%2Flibrecmc.git netifd: strip mask from IP address in DHCP client params ipaddr option can be in CIDR notation, but udhcp wants just an IP address Signed-off-by: Andrey Erokhin (cherry picked from commit 506bb436c678779e8ee54e83a7fb3e4e880037ec) --- diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index ea6d872eb4..636b4654ff 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -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