busybox: update to 1.28.2
[openwrt/openwrt.git] / package / utils / busybox / patches / 230-add_nslookup_lede.patch
index 14c0e87b33812d0929b03bce10e039efd248eeb2..f0ac4b51c15ab5270abd81a68d36f60a984fbb78 100644 (file)
@@ -34,7 +34,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  # However, on *other platforms* it fails when some of those flags
 --- /dev/null
 +++ b/networking/nslookup_lede.c
-@@ -0,0 +1,915 @@
+@@ -0,0 +1,914 @@
 +/*
 + * nslookup_lede - musl compatible replacement for busybox nslookup
 + *
@@ -752,18 +752,6 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
 +      return buf;
 +}
 +
-+
-+#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS
-+static const char nslookup_longopts[] ALIGN1 =
-+              "type\0"                Required_argument       "q"
-+              "querytype\0"   Required_argument       "q"
-+              "port\0"                Required_argument       "p"
-+              "retry\0"               Required_argument       "r"
-+              "timeout\0"             Required_argument       "t"
-+              "stats\0"               Required_argument       "s"
-+    ;
-+#endif
-+
 +int nslookup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 +int nslookup_main(int argc, char **argv)
 +{
@@ -779,13 +767,24 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
 +      HEADER *header;
 +
 +#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS
-+      applet_long_options = nslookup_longopts;
-+#endif
++      static const char nslookup_longopts[] ALIGN1 =
++              "type\0"                Required_argument       "q"
++              "querytype\0"           Required_argument       "q"
++              "port\0"                Required_argument       "p"
++              "retry\0"               Required_argument       "r"
++              "timeout\0"             Required_argument       "t"
++              "stats\0"               No_argument             "s"
++      ;
 +
-+      opt_complementary = "q::";
-+      opts = getopt32(argv, "+q:*p:+r:+t:+s",
++      opts = getopt32long(argv, "^" "+q:*p:+r:+t:+s" "\0" "q::",
++                      nslookup_longopts,
++                      &type_strings, &default_port,
++                      &default_retry, &default_timeout);
++#else
++      opts = getopt32(argv, "^" "+q:*p:+r:+t:+s" "\0" "q::",
 +                      &type_strings, &default_port,
 +                      &default_retry, &default_timeout);
++#endif
 +
 +      while (type_strings) {
 +              ptr = llist_pop(&type_strings);