From 2f5b612837ce44c96bb9d6e32d5d9b88c14a259d Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 9 Nov 2023 12:30:29 +0100 Subject: [PATCH] busybox: fix udhcpc endless loop if the interface is down due to ip-collide detection, config apply fail as the dnsmasq init script would loop endlessly. Signed-off-by: John Crispin --- ...ould-enter-an-endless-loop-if-the-in.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 patches/0065-busybox-udhcpc-would-enter-an-endless-loop-if-the-in.patch diff --git a/patches/0065-busybox-udhcpc-would-enter-an-endless-loop-if-the-in.patch b/patches/0065-busybox-udhcpc-would-enter-an-endless-loop-if-the-in.patch new file mode 100644 index 000000000..1b1006ef3 --- /dev/null +++ b/patches/0065-busybox-udhcpc-would-enter-an-endless-loop-if-the-in.patch @@ -0,0 +1,34 @@ +From 912cf16c2f15d2081049eafe8d336dbc2b7d8c78 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Thu, 9 Nov 2023 12:28:38 +0100 +Subject: [PATCH] busybox: udhcpc would enter an endless loop if the interface + is down + +Signed-off-by: John Crispin +--- + .../busybox/patches/532-dhcp-socket-reopen.patch | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + create mode 100644 package/utils/busybox/patches/532-dhcp-socket-reopen.patch + +diff --git a/package/utils/busybox/patches/532-dhcp-socket-reopen.patch b/package/utils/busybox/patches/532-dhcp-socket-reopen.patch +new file mode 100644 +index 0000000000..17cec7764a +--- /dev/null ++++ b/package/utils/busybox/patches/532-dhcp-socket-reopen.patch +@@ -0,0 +1,13 @@ ++Index: busybox-1.36.1/networking/udhcp/dhcpc.c ++=================================================================== ++--- busybox-1.36.1.orig/networking/udhcp/dhcpc.c +++++ busybox-1.36.1/networking/udhcp/dhcpc.c ++@@ -1638,6 +1645,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c ++ bb_error_msg("read error: "STRERROR_FMT", reopening socket" STRERROR_ERRNO); ++ sleep(discover_timeout); /* 3 seconds by default */ ++ change_listen_mode(client_data.listen_mode); /* just close and reopen */ +++ packet_num++; +++ timeout = 0; ++ } ++ if (len < 0) ++ continue; +-- +2.34.1 +