aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/busybox/patches
diff options
context:
space:
mode:
Diffstat (limited to 'package/utils/busybox/patches')
-rw-r--r--package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch10
-rw-r--r--package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch6
-rw-r--r--package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch10
-rw-r--r--package/utils/busybox/patches/205-udhcpc_allow_zero_length_options.patch49
-rw-r--r--package/utils/busybox/patches/220-add_lock_util.patch6
-rw-r--r--package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch2
-rw-r--r--package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch42
-rw-r--r--package/utils/busybox/patches/530-use-SOURCE_DATE_EPOCH-for-timestamp-if-available.patch80
-rw-r--r--package/utils/busybox/patches/540-nslookup-mention-QUERY_TYPE-SRV.patch30
9 files changed, 54 insertions, 181 deletions
diff --git a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch
index 2e67009224f..c0f234ee421 100644
--- a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch
+++ b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch
@@ -1,18 +1,18 @@
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
-@@ -712,6 +712,7 @@ static int bcast_or_ucast(struct dhcp_pa
- static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
+@@ -722,6 +722,7 @@ static int bcast_or_ucast(struct dhcp_pa
+ static NOINLINE int send_discover(uint32_t requested)
{
struct dhcp_packet packet;
+ static int msgs = 0;
/* Fill in: op, htype, hlen, cookie, chaddr fields,
- * random xid field (we override it below),
-@@ -729,6 +730,7 @@ static NOINLINE int send_discover(uint32
+ * xid field, message type option:
+@@ -736,6 +737,7 @@ static NOINLINE int send_discover(uint32
*/
add_client_options(&packet);
+ if (msgs++ < 3)
- bb_info_msg("sending %s", "discover");
+ bb_simple_info_msg("broadcasting discover");
return raw_bcast_from_client_data_ifindex(&packet, INADDR_ANY);
}
diff --git a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch
index 875f2ce5fc4..a4bda992c42 100644
--- a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch
+++ b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch
@@ -1,8 +1,8 @@
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
-@@ -1415,6 +1415,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
- /* silence "uninitialized!" warning */
- unsigned timestamp_before_wait = timestamp_before_wait;
+@@ -1384,6 +1384,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ struct pollfd pfds[2];
+ struct dhcp_packet packet;
+ /* When running on a bridge, the ifindex may have changed (e.g. if
+ * member interfaces were added/removed or if the status of the
diff --git a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch
deleted file mode 100644
index 88a98c0a1c8..00000000000
--- a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/networking/udhcp/dhcpc.c
-+++ b/networking/udhcp/dhcpc.c
-@@ -1125,7 +1125,6 @@ static void perform_renew(void)
- client_data.state = RENEW_REQUESTED;
- break;
- case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
-- udhcp_run_script(NULL, "deconfig");
- case REQUESTING:
- case RELEASED:
- change_listen_mode(LISTEN_RAW);
diff --git a/package/utils/busybox/patches/205-udhcpc_allow_zero_length_options.patch b/package/utils/busybox/patches/205-udhcpc_allow_zero_length_options.patch
deleted file mode 100644
index abe8baf54f3..00000000000
--- a/package/utils/busybox/patches/205-udhcpc_allow_zero_length_options.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 7eed119b84b0f7efb7ef351940dd895dc2379eb3 Mon Sep 17 00:00:00 2001
-From: Russell Senior <russell@personaltelco.net>
-Date: Mon, 15 Mar 2021 23:27:58 -0700
-Subject: [PATCH v2] udhcpc: ignore zero-length DHCP options
-
-Discovered that the DHCP server on a TrendNet router (unknown model)
-provides a zero-length option 12 (Host Name) in the DHCP ACK message. This
-has the effect of causing udhcpc to drop the rest of the options, including
-option 51 (IP Address Lease Time), 3 (Router), and 6 (Domain Name Server),
-most importantly leaving the OpenWrt device with no default gateway.
-
-The TrendNet behavior violates RFC 2132, which in Section 3.14 declares that
-option 12 has a miniumum length of 1 octet. It is perhaps not a cosmic coincidence
-that I found this behavior on Pi Day.
-
-This patch allows zero length options without bailing out, by simply skipping them.
-
-v2 changelog:
-* advance the optionptr by two bytes, not one;
-* add a message to warn about the rfc violation;
-
-Signed-off-by: Russell Senior <russell@personaltelco.net>
----
- networking/udhcp/common.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
-index 4bc719001..a16fd85d0 100644
---- a/networking/udhcp/common.c
-+++ b/networking/udhcp/common.c
-@@ -277,8 +277,13 @@ uint8_t* FAST_FUNC udhcp_scan_options(struct dhcp_packet *packet, struct dhcp_sc
- goto complain; /* complain and return NULL */
- len = 2 + scan_state->optionptr[OPT_LEN];
- scan_state->rem -= len;
-- /* So far no valid option with length 0 known. */
-- if (scan_state->rem < 0 || scan_state->optionptr[OPT_LEN] == 0)
-+ /* skip any options with zero length */
-+ if (scan_state->optionptr[OPT_LEN] == 0) {
-+ scan_state->optionptr += 2;
-+ bb_simple_error_msg("warning: zero length DHCP option violates rfc2132, skipping");
-+ continue;
-+ }
-+ if (scan_state->rem < 0)
- goto complain; /* complain and return NULL */
-
- if (scan_state->optionptr[OPT_CODE] == DHCP_OPTION_OVERLOAD) {
---
-2.30.1
-
diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
index 4e46b74f0e7..579b705f346 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -72,9 +72,9 @@
+
+static int do_lock(void)
+{
-+ int pid;
++ pid_t pid;
+ int flags;
-+ char pidstr[8];
++ char pidstr[12];
+
+ if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
+ if ((fd = open(file, O_RDWR)) < 0) {
@@ -109,7 +109,7 @@
+ if (!waitonly) {
+ lseek(fd, 0, SEEK_SET);
+ ftruncate(fd, 0);
-+ sprintf(pidstr, "%d\n", pid);
++ snprintf(pidstr, sizeof(pidstr), "%d\n", pid);
+ write(fd, pidstr, strlen(pidstr));
+ close(fd);
+ }
diff --git a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch
index f7cd2322c90..f4c0a809225 100644
--- a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch
+++ b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch
@@ -1,6 +1,6 @@
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
-@@ -652,7 +652,7 @@ static int do_add_or_delete(char **argv,
+@@ -683,7 +683,7 @@ static int do_add_or_delete(char **argv,
}
xrtnl_open(&rth);
ll_init_map(&rth);
diff --git a/package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch b/package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch
new file mode 100644
index 00000000000..caa5ee78f35
--- /dev/null
+++ b/package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch
@@ -0,0 +1,42 @@
+From: Uwe Kleine-König <uwe@kleine-koenig.org>
+Date: Sat, 8 Oct 2022 19:22:52 +0200
+Subject: [PATCH] nslookup: ensure unique transaction IDs for the DNS queries
+
+The transaction IDs generated by res_mkquery() for both glibc and musl only
+depends on the state of the monotonic clock.
+For some machines (here: a TP-Link RE200 powered by a MediaTek MT7620A)
+the monotonic clock has a coarse resolution (here: 20 µs) and it can happen
+that the requests for A and AAAA share the same transaction ID.
+
+In that case the mapping from received responses to the sent queries
+doesn't work and name resolution fails as follows:
+
+ # /bin/busybox nslookup heise.de
+ Server: 127.0.0.1
+ Address: 127.0.0.1:53
+
+ Non-authoritative answer:
+ Name: heise.de
+ Address: 193.99.144.80
+
+ *** Can't find heise.de: No answer
+
+because the AAAA reply is dropped as a duplicate reply to the A query.
+
+To prevent this make sure the transaction IDs are unique.
+
+Forwarded: http://lists.busybox.net/pipermail/busybox/2022-October/089911.html
+---
+--- a/networking/nslookup.c
++++ b/networking/nslookup.c
+@@ -978,6 +978,10 @@ int nslookup_main(int argc UNUSED_PARAM,
+ }
+ }
+
++ /* Ensure the Transaction IDs are unique */
++ for (rc = 1; rc < G.query_count; rc++)
++ G.query[rc].query[1] = G.query[rc - 1].query[1] + 1;
++
+ for (rc = 0; rc < G.serv_count;) {
+ int c;
+
diff --git a/package/utils/busybox/patches/530-use-SOURCE_DATE_EPOCH-for-timestamp-if-available.patch b/package/utils/busybox/patches/530-use-SOURCE_DATE_EPOCH-for-timestamp-if-available.patch
deleted file mode 100644
index af473622ed2..00000000000
--- a/package/utils/busybox/patches/530-use-SOURCE_DATE_EPOCH-for-timestamp-if-available.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 59f773ee81a8945321f4aa20abc5e9577e6483e4 Mon Sep 17 00:00:00 2001
-From: Paul Spooren <mail@aparcar.org>
-Date: Thu, 13 May 2021 11:25:34 +0200
-Subject: [PATCH] use SOURCE_DATE_EPOCH for timestamp if available
-
-The SOURCE_DATE_EPOCH is an effort of the Reproducible Builds
-organization to make timestamps/build dates in compiled tools
-deterministic over several repetitive builds.
-
-Busybox shows by default the build date timestamp which changes whenever
-compiled. To have a reasonable accurate build date while staying
-reproducible, it's possible to use the *date of last source
-modification* rather than the current time and date.
-
-Further information on SOURCE_DATE_EPOCH are available online [1].
-
-This patch modifies `confdata.c` so that the content of the
-SOURCE_DATE_EPOCH env variable is used as timestamp.
-
-To be independent of different timezones between builds, whenever
-SOURCE_DATE_EPOCH is defined the GMT time is used.
-
-[1]: https://reproducible-builds.org/docs/source-date-epoch/
-
-Signed-off-by: Paul Spooren <mail@aparcar.org>
----
- scripts/kconfig/confdata.c | 17 ++++++++++++++---
- 1 file changed, 14 insertions(+), 3 deletions(-)
-
-diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
-index b05b96e45..73c25e3a8 100644
---- a/scripts/kconfig/confdata.c
-+++ b/scripts/kconfig/confdata.c
-@@ -342,6 +342,8 @@ int conf_write(const char *name)
- time_t now;
- int use_timestamp = 1;
- char *env;
-+ char *source_date_epoch;
-+ struct tm *build_time;
-
- dirname[0] = 0;
- if (name && name[0]) {
-@@ -378,7 +380,16 @@ int conf_write(const char *name)
- }
- sym = sym_lookup("KERNELVERSION", 0);
- sym_calc_value(sym);
-- time(&now);
-+
-+ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
-+ if (source_date_epoch && *source_date_epoch) {
-+ now = strtoull(source_date_epoch, NULL, 10);
-+ build_time = gmtime(&now);
-+ } else {
-+ time(&now);
-+ build_time = localtime(&now);
-+ }
-+
- env = getenv("KCONFIG_NOTIMESTAMP");
- if (env && *env)
- use_timestamp = 0;
-@@ -398,14 +409,14 @@ int conf_write(const char *name)
- if (use_timestamp) {
- size_t ret = \
- strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
-- "\"%Y-%m-%d %H:%M:%S %Z\"\n", localtime(&now));
-+ "\"%Y-%m-%d %H:%M:%S %Z\"\n", build_time);
- /* if user has Factory timezone or some other odd install, the
- * %Z above will overflow the string leaving us with undefined
- * results ... so let's try again without the timezone.
- */
- if (ret == 0)
- strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
-- "\"%Y-%m-%d %H:%M:%S\"\n", localtime(&now));
-+ "\"%Y-%m-%d %H:%M:%S\"\n", build_time);
- } else { /* bbox */
- strcpy(buf, "#define AUTOCONF_TIMESTAMP \"\"\n");
- }
---
-2.30.2
-
diff --git a/package/utils/busybox/patches/540-nslookup-mention-QUERY_TYPE-SRV.patch b/package/utils/busybox/patches/540-nslookup-mention-QUERY_TYPE-SRV.patch
deleted file mode 100644
index ac9afa34ef7..00000000000
--- a/package/utils/busybox/patches/540-nslookup-mention-QUERY_TYPE-SRV.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From a0136f24f788e8bfc4ab74a647b27e115a25d9fb Mon Sep 17 00:00:00 2001
-From: Paul Spooren <mail@aparcar.org>
-Date: Wed, 19 May 2021 00:55:21 +0200
-Subject: [PATCH] nslookup: mention QUERY_TYPE SRV
-
-SRV lookups are supported since "6b4960155 nslookup: implement support
-for SRV records" and should therefore be mentioned as a possible
-QUERY_TYPE in the help message.
-
-Signed-off-by: Paul Spooren <mail@aparcar.org>
----
- networking/nslookup.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/networking/nslookup.c b/networking/nslookup.c
-index dda22de0e..2ae8d391c 100644
---- a/networking/nslookup.c
-+++ b/networking/nslookup.c
-@@ -25,7 +25,7 @@
- //usage:#define nslookup_full_usage "\n\n"
- //usage: "Query DNS about HOST"
- //usage: IF_FEATURE_NSLOOKUP_BIG("\n")
--//usage: IF_FEATURE_NSLOOKUP_BIG("\nQUERY_TYPE: soa,ns,a,"IF_FEATURE_IPV6("aaaa,")"cname,mx,txt,ptr,any")
-+//usage: IF_FEATURE_NSLOOKUP_BIG("\nQUERY_TYPE: soa,ns,a,"IF_FEATURE_IPV6("aaaa,")"cname,mx,txt,ptr,srv,any")
- //usage:#define nslookup_example_usage
- //usage: "$ nslookup localhost\n"
- //usage: "Server: default\n"
---
-2.30.2
-