[openwrt/openwrt] netifd: strip mask from IP address in DHCP client params

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 1 13:43:47 PDT 2023


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/506bb436c678779e8ee54e83a7fb3e4e880037ec

commit 506bb436c678779e8ee54e83a7fb3e4e880037ec
Author: Andrey Erokhin <a.erokhin at inango-systems.com>
AuthorDate: Tue Mar 7 16:52:58 2023 +0500

    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 <a.erokhin at inango-systems.com>
---
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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




More information about the lede-commits mailing list