Skip to contentSkip to conversation

busybox: background udhcpc by default if no lease is obtained

PATCH In review Lothar Felten 2 participants 2 messages Dec 16, 2021 – Jan 8, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: background udhcpc by default if no lease is obtained

The current behavior for busybox' udhcpc is to terminate if no lease is obtained at start up. Therefore no address is acquired if the link is established afterwards.

By setting the -b flag udhcpc will background allowing the link to be established at any time.

---
 package/busybox/busybox.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/busybox/busybox.config +1 -1
index 1ea810e5be..a854747286 100644
@@ -970,7 +970,7 @@ CONFIG_UDHCP_DEBUG=0
 CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
 CONFIG_FEATURE_UDHCP_RFC3397=y
 CONFIG_FEATURE_UDHCP_8021Q=y
-CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n -O search"
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-b -R -n -O search"
 
 #
 # Print Utilities
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Lothar" == Lothar Felten <[email protected]> writes:

The current behavior for busybox' udhcpc is to terminate if no lease is obtained at start up. Therefore no address is acquired if the link is established afterwards.

By setting the -b flag udhcpc will background allowing the link to be established at any time.

I was afraid that this would break the avahi-autoipd fallback logic, but looking at the udhcpc logic it still triggers the leasefail action on timeout, so that should be fine.

Quoted 9 lines
---
 package/busybox/busybox.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/busybox/busybox.config +0 -0
index 1ea810e5be..a854747286 100644

package/busybox/busybox.config CONFIG_UDHCP_DEBUG=0 · line 973

Quoted 5 lines
package/busybox/busybox.config +1 -1
@@ -970,7 +970,7 @@ CONFIG_UDHCP_DEBUG=0
 CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
 CONFIG_FEATURE_UDHCP_RFC3397=y
 CONFIG_FEATURE_UDHCP_8021Q=y
-CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n -O search"
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-b -R -n -O search"

Using -b (background on lease fail) and -n (exit on lease fail) together doesn't make much sense, so I've dropped -n. We also have busybox-minimal.config, so I've added it there as well and applied, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot