Based on Peter Wagner's busybox 1.20.0 patch.
<[email protected]>

Signed-off-by: Jonathan McCrohan <[email protected]>
---
 package/busybox/Makefile                           |    6 +-
 package/busybox/config/Config.in                   |   44 +++-
 package/busybox/config/archival/Config.in          |   22 +-
 package/busybox/config/console-tools/Config.in     |    1 -
 package/busybox/config/coreutils/Config.in         |   20 +-
 package/busybox/config/debianutils/Config.in       |    1 -
 package/busybox/config/e2fsprogs/Config.in         |    1 -
 .../config/e2fsprogs/old_e2fsprogs/Config.in       |    1 -
 package/busybox/config/libbb/Config.in             |   13 +-
 package/busybox/config/loginutils/Config.in        |   18 ++
 package/busybox/config/mailutils/Config.in         |    1 -
 package/busybox/config/miscutils/Config.in         |    7 +-
 package/busybox/config/networking/Config.in        |   18 +-
 package/busybox/config/networking/udhcp/Config.in  |    6 +-
 package/busybox/config/printutils/Config.in        |    1 -
 package/busybox/config/procps/Config.in            |   16 +-
 package/busybox/config/runit/Config.in             |    1 -
 package/busybox/config/selinux/Config.in           |    1 -
 package/busybox/config/shell/Config.in             |    4 +
 package/busybox/config/sysklogd/Config.in          |    1 -
 package/busybox/config/util-linux/Config.in        |  124 +++++-----
 ...se_md5_hash_by_default_like_it_used_to_be.patch |   20 --
 .../004-upstream-percent_decode_in_place.patch     |  237 --------------------
 .../patches/241-udhcpc-oversized_packets.patch     |   26 ++-
 .../patches/244-udhcpc_add_6rd_option.patch        |  141 +-----------
 package/busybox/patches/310-passwd_access.patch    |   41 ----
 package/busybox/patches/350-httpd_redir.patch      |   27 +--
 .../busybox/patches/700-hexdump_segfault_fix.patch |   11 -
 28 files changed, 237 insertions(+), 573 deletions(-)
 delete mode 100644 
package/busybox/patches/002-passwd_use_md5_hash_by_default_like_it_used_to_be.patch
 delete mode 100644 
package/busybox/patches/004-upstream-percent_decode_in_place.patch
 delete mode 100644 package/busybox/patches/310-passwd_access.patch
 delete mode 100644 package/busybox/patches/700-hexdump_segfault_fix.patch

diff --git a/package/busybox/Makefile b/package/busybox/Makefile
index ef7f518..0651515 100644
--- a/package/busybox/Makefile
+++ b/package/busybox/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
-PKG_VERSION:=1.19.4
-PKG_RELEASE:=2
+PKG_VERSION:=1.20.1
+PKG_RELEASE:=1
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.busybox.net/downloads \
                http://distfiles.gentoo.org/distfiles/
-PKG_MD5SUM:=9c0cae5a0379228e7b55e5b29528df8e
+PKG_MD5SUM:=af2fededb6dca804544c05684636e574
 
 PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_FEATURE_HAVE_RPC:librpc
 PKG_BUILD_PARALLEL:=1
diff --git a/package/busybox/config/Config.in b/package/busybox/config/Config.in
index 0045036..cddc2f6 100644
--- a/package/busybox/config/Config.in
+++ b/package/busybox/config/Config.in
@@ -82,20 +82,21 @@ config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS
 endchoice
 
 config BUSYBOX_CONFIG_SHOW_USAGE
-       bool "Show terse applet usage messages"
+       bool "Show applet usage messages"
        default y
        help
-         All BusyBox applets will show help messages when invoked with
-         wrong arguments. You can turn off printing these terse usage
-         messages if you say no here.
-         This will save you up to 7k.
+         Enabling this option, BusyBox applets will show terse help messages
+         when invoked with wrong arguments.
+         If you do not want to show any (helpful) usage message when
+         issuing wrong command syntax, you can say 'N' here,
+         saving approximately 7k.
 
 config BUSYBOX_CONFIG_FEATURE_VERBOSE_USAGE
        bool "Show verbose applet usage messages"
        default y
        depends on BUSYBOX_CONFIG_SHOW_USAGE
        help
-         All BusyBox applets will show more verbose help messages when
+         All BusyBox applets will show verbose help messages when
          busybox is invoked with --help. This will add a lot of text to the
          busybox binary. In the default configuration, this will add about
          13k, but it can add much more depending on your configuration.
@@ -105,8 +106,8 @@ config BUSYBOX_CONFIG_FEATURE_COMPRESS_USAGE
        default y
        depends on BUSYBOX_CONFIG_SHOW_USAGE
        help
-         Store usage messages in compressed form, uncompress them on-the-fly
-         when <applet> --help is called.
+         Store usage messages in .bz compressed form, uncompress them
+         on-the-fly when <applet> --help is called.
 
          If you have a really tiny busybox with few applets enabled (and
          bunzip2 isn't one of them), the overhead of the decompressor might
@@ -598,12 +599,39 @@ config BUSYBOX_CONFIG_CROSS_COMPILER_PREFIX
 
          Native builds leave this empty.
 
+config BUSYBOX_CONFIG_SYSROOT
+       string "Path to sysroot"
+       default ""
+       help
+         If you want to build BusyBox with a cross compiler, then you
+         might also need to specify where /usr/include and /usr/lib
+         will be found.
+
+         For example, BusyBox can be built against an installed
+         Android NDK, platform version 9, for ARM ABI with
+
+         CONFIG_SYSROOT=/opt/android-ndk/platforms/android-9/arch-arm
+
+         Native builds leave this empty.
+
 config BUSYBOX_CONFIG_EXTRA_CFLAGS
        string "Additional CFLAGS"
        default ""
        help
          Additional CFLAGS to pass to the compiler verbatim.
 
+config BUSYBOX_CONFIG_EXTRA_LDFLAGS
+       string "Additional LDFLAGS"
+       default ""
+       help
+         Additional LDFLAGS to pass to the linker verbatim.
+
+config BUSYBOX_CONFIG_EXTRA_LDLIBS
+       string "Additional LDLIBS"
+       default ""
+       help
+         Additional LDLIBS to pass to the linker with -l.
+
 endmenu
 
 menu 'Debugging Options'
diff --git a/package/busybox/config/archival/Config.in 
b/package/busybox/config/archival/Config.in
index d2bfa48..fa3d18c 100644
--- a/package/busybox/config/archival/Config.in
+++ b/package/busybox/config/archival/Config.in
@@ -7,7 +7,6 @@
 menu "Archival Utilities"
 
 
-
 config BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ
        bool "Make tar, rpm, modprobe etc understand .xz data"
        default n
@@ -33,10 +32,10 @@ config BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ
          Make tar, rpm, modprobe etc understand .gz data.
 
 config BUSYBOX_CONFIG_FEATURE_SEAMLESS_Z
-       bool "Make tar and gunzip understand .Z data"
+       bool "tar, rpm, modprobe etc understand .Z data"
        default n
        help
-         Make tar and gunzip understand .Z data.
+         Make tar, rpm, modprobe etc understand .Z data.
 
 config BUSYBOX_CONFIG_AR
        bool "ar"
@@ -188,6 +187,18 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LONG_OPTIONS
        help
          Enable use of long options, increases size by about 106 Bytes
 
+config BUSYBOX_CONFIG_GZIP_FAST
+       int "Trade memory for gzip speed (0:small,slow - 2:fast,big)"
+       default 0
+       range 0 2
+       depends on BUSYBOX_CONFIG_GZIP
+       help
+         Enable big memory options for gzip.
+         0: small buffers, small hash-tables
+         1: larger buffers, larger hash-tables
+         2: larger buffers, largest hash-tables
+         Larger models may give slightly better compression
+
 config BUSYBOX_CONFIG_LZOP
        bool "lzop"
        default n
@@ -331,12 +342,9 @@ config BUSYBOX_CONFIG_UNLZMA
          is generally considerably better than that achieved by the bzip2
          compressors.
 
-         The BusyBox unlzma applet is limited to de-compression only.
+         The BusyBox unlzma applet is limited to decompression only.
          On an x86 system, this applet adds about 4K.
 
-         Unless you have a specific application which requires unlzma, you
-         should probably say N here.
-
 config BUSYBOX_CONFIG_FEATURE_LZMA_FAST
        bool "Optimize unlzma for speed"
        default n
diff --git a/package/busybox/config/console-tools/Config.in 
b/package/busybox/config/console-tools/Config.in
index 9069b0f..d996230 100644
--- a/package/busybox/config/console-tools/Config.in
+++ b/package/busybox/config/console-tools/Config.in
@@ -7,7 +7,6 @@
 menu "Console Utilities"
 
 
-
 config BUSYBOX_CONFIG_CHVT
        bool "chvt"
        default n
diff --git a/package/busybox/config/coreutils/Config.in 
b/package/busybox/config/coreutils/Config.in
index b1a432f..b49bc9b 100644
--- a/package/busybox/config/coreutils/Config.in
+++ b/package/busybox/config/coreutils/Config.in
@@ -58,6 +58,12 @@ config BUSYBOX_CONFIG_FEATURE_DATE_COMPAT
          With this option off, 'date DATE' is 'date -s DATE' support
          the same format. With it on, 'date DATE' additionally supports
          MMDDhhmm[[YY]YY][.ss] format.
+config BUSYBOX_CONFIG_HOSTID
+       bool "hostid"
+       default y
+       help
+         hostid prints the numeric identifier (in hexadecimal) for
+         the current host.
 config BUSYBOX_CONFIG_ID
        bool "id"
        default y
@@ -88,6 +94,13 @@ config BUSYBOX_CONFIG_TOUCH
        help
          touch is used to create or change the access and/or
          modification timestamp of specified files.
+
+config BUSYBOX_CONFIG_FEATURE_TOUCH_SUSV3
+       bool "Add support for SUSV3 features (-d -t -r)"
+       default n
+       depends on BUSYBOX_CONFIG_TOUCH
+       help
+         Enable touch to use a reference file or a given date/time argument.
 config BUSYBOX_CONFIG_TR
        bool "tr"
        default y
@@ -393,13 +406,6 @@ config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD
        help
          This enables the head options (-c, -q, and -v).
 
-config BUSYBOX_CONFIG_HOSTID
-       bool "hostid"
-       default y
-       help
-         hostid prints the numeric identifier (in hexadecimal) for
-         the current host.
-
 config BUSYBOX_CONFIG_INSTALL
        bool "install"
        default n
diff --git a/package/busybox/config/debianutils/Config.in 
b/package/busybox/config/debianutils/Config.in
index be69666..093d62b 100644
--- a/package/busybox/config/debianutils/Config.in
+++ b/package/busybox/config/debianutils/Config.in
@@ -7,7 +7,6 @@
 menu "Debian Utilities"
 
 
-
 config BUSYBOX_CONFIG_MKTEMP
        bool "mktemp"
        default y
diff --git a/package/busybox/config/e2fsprogs/Config.in 
b/package/busybox/config/e2fsprogs/Config.in
index 282681d..ba7fb3b 100644
--- a/package/busybox/config/e2fsprogs/Config.in
+++ b/package/busybox/config/e2fsprogs/Config.in
@@ -7,7 +7,6 @@
 menu "Linux Ext2 FS Progs"
 
 
-
 config BUSYBOX_CONFIG_CHATTR
        bool "chattr"
        default n
diff --git a/package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in 
b/package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in
index 105c93a..c4b6c05d 100644
--- a/package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in
+++ b/package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in
@@ -7,7 +7,6 @@
 menu "Linux Ext2 FS Progs"
 
 
-
 config BUSYBOX_CONFIG_CHATTR
        bool "chattr"
        default n
diff --git a/package/busybox/config/libbb/Config.in 
b/package/busybox/config/libbb/Config.in
index 6475403..4b7ae4f 100644
--- a/package/busybox/config/libbb/Config.in
+++ b/package/busybox/config/libbb/Config.in
@@ -28,7 +28,7 @@ config BUSYBOX_CONFIG_PASSWORD_MINLEN
        help
          Minimum allowable password length.
 
-config BUSYBOX_CONFIG_MD5_SIZE_VS_SPEED
+config BUSYBOX_CONFIG_MD5_SMALL
        int "MD5: Trade bytes for speed (0:fast, 3:slow)"
        default 2
        range 0 3
@@ -108,6 +108,13 @@ config BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY
        help
          Enable history saving in shells.
 
+config BUSYBOX_CONFIG_FEATURE_EDITING_SAVE_ON_EXIT
+       bool "Save history on shell exit, not after every command"
+       default n
+       depends on BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY
+       help
+         Save history on shell exit, not after every command.
+
 config BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH
        bool "Reverse history search"
        default n
@@ -198,8 +205,8 @@ config BUSYBOX_CONFIG_FEATURE_SKIP_ROOTFS
 
          However, some systems do not mount anything on /.
          If you need to configure busybox for one of these systems,
-         you may find useful to turn this option off to make df show
-         initramfs statistic.
+         you may find it useful to turn this option off to make df show
+         initramfs statistics.
 
          Otherwise, choose Y.
 
diff --git a/package/busybox/config/loginutils/Config.in 
b/package/busybox/config/loginutils/Config.in
index 8c32851..1043b51 100644
--- a/package/busybox/config/loginutils/Config.in
+++ b/package/busybox/config/loginutils/Config.in
@@ -216,6 +216,17 @@ config BUSYBOX_CONFIG_LOGIN
          Note that Busybox binary must be setuid root for this applet to
          work properly.
 
+config BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD
+       bool "Run logged in session in a child process"
+       default n if BUSYBOX_CONFIG_PAM
+       depends on BUSYBOX_CONFIG_LOGIN
+       help
+         Run the logged in session in a child process.  This allows
+         login to clean up things such as utmp entries or PAM sessions
+         when the login session is complete.  If you use PAM, you
+         almost always would want this to be set to Y, else PAM session
+         will not be cleaned up.
+
 config BUSYBOX_CONFIG_PAM
        bool "Support for PAM (Pluggable Authentication Modules)"
        default n
@@ -288,6 +299,13 @@ config BUSYBOX_CONFIG_CHPASSWD
          Reads a file of user name and password pairs from standard input
          and uses this information to update a group of existing users.
 
+config BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO
+       string "Default password encryption method (passwd -a, cryptpw -m 
parameter)"
+       default "md5"
+       depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW
+       help
+         Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512".
+
 config BUSYBOX_CONFIG_SU
        bool "su"
        default n
diff --git a/package/busybox/config/mailutils/Config.in 
b/package/busybox/config/mailutils/Config.in
index 8db3031..f2d3a8d 100644
--- a/package/busybox/config/mailutils/Config.in
+++ b/package/busybox/config/mailutils/Config.in
@@ -2,7 +2,6 @@
 menu "Mail Utilities"
 
 
-
 config BUSYBOX_CONFIG_MAKEMIME
        bool "makemime"
        default n
diff --git a/package/busybox/config/miscutils/Config.in 
b/package/busybox/config/miscutils/Config.in
index e69d684..aeef44d 100644
--- a/package/busybox/config/miscutils/Config.in
+++ b/package/busybox/config/miscutils/Config.in
@@ -36,14 +36,11 @@ config BUSYBOX_CONFIG_FEATURE_LESS_BRACKETS
          brackets, facilitating programming.
 
 config BUSYBOX_CONFIG_FEATURE_LESS_FLAGS
-       bool "Enable extra flags"
+       bool "Enable -m/-M"
        default n
        depends on BUSYBOX_CONFIG_LESS
        help
-         The extra flags provided do the following:
-
-         The -M flag enables a more sophisticated status line.
-         The -m flag enables a simpler status line with a percentage.
+         The -M/-m flag enables a more sophisticated status line.
 
 config BUSYBOX_CONFIG_FEATURE_LESS_MARKS
        bool "Enable marks"
diff --git a/package/busybox/config/networking/Config.in 
b/package/busybox/config/networking/Config.in
index 3df7b1f..90cdc75 100644
--- a/package/busybox/config/networking/Config.in
+++ b/package/busybox/config/networking/Config.in
@@ -102,7 +102,7 @@ config BUSYBOX_CONFIG_WHOIS
 
 config BUSYBOX_CONFIG_FEATURE_IPV6
        bool "Enable IPv6 support"
-       default IPV6
+       default y
        help
          Enable IPv6 support in busybox.
          This adds IPv6 support in the networking applets.
@@ -292,14 +292,22 @@ config BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH
        help
          Utilizes password settings from /etc/httpd.conf for basic
          authentication on a per url basis.
+         Example for httpd.conf file:
+         /adm:toor:PaSsWd
 
 config BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5
        bool "Support MD5 crypted passwords for http Authentication"
        default n
        depends on BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH
        help
-         Enables basic per URL authentication from /etc/httpd.conf
-         using md5 passwords.
+         Enables encrypted passwords, and wildcard user/passwords
+         in httpd.conf file.
+         User '*' means 'any system user name is ok',
+         password of '*' means 'use system password for this user'
+         Examples:
+         /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0
+         /adm:root:*
+         /wiki:*:*
 
 config BUSYBOX_CONFIG_FEATURE_HTTPD_CGI
        bool "Support Common Gateway Interface (CGI)"
@@ -316,8 +324,8 @@ config 
BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
        help
          This option enables support for running scripts through an
          interpreter. Turn this on if you want PHP scripts to work
-         properly. You need to supply an additional line in your httpd
-         config file:
+         properly. You need to supply an additional line in your
+         httpd.conf file:
          *.php:/path/to/your/php
 
 config BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
diff --git a/package/busybox/config/networking/udhcp/Config.in 
b/package/busybox/config/networking/udhcp/Config.in
index f4d26ec..4c21508 100644
--- a/package/busybox/config/networking/udhcp/Config.in
+++ b/package/busybox/config/networking/udhcp/Config.in
@@ -4,7 +4,11 @@
 # see scripts/kbuild/config-language.txt.
 #
 
-
+config BUSYBOX_CONFIG_UDHCPC6
+       bool "udhcp client for DHCPv6 (udhcpc6)"
+       default n  # not yet ready
+       help
+         udhcpc6 is a DHCPv6 client
 
 config BUSYBOX_CONFIG_UDHCPD
        bool "udhcp server (udhcpd)"
diff --git a/package/busybox/config/printutils/Config.in 
b/package/busybox/config/printutils/Config.in
index ca2ea9f..8ee9f20 100644
--- a/package/busybox/config/printutils/Config.in
+++ b/package/busybox/config/printutils/Config.in
@@ -7,7 +7,6 @@
 menu "Print Utilities"
 
 
-
 config BUSYBOX_CONFIG_LPD
        bool "lpd"
        default n
diff --git a/package/busybox/config/procps/Config.in 
b/package/busybox/config/procps/Config.in
index 25eb3e5..0bd0711 100644
--- a/package/busybox/config/procps/Config.in
+++ b/package/busybox/config/procps/Config.in
@@ -11,6 +11,12 @@ config BUSYBOX_CONFIG_IOSTAT
        default n
        help
          Report CPU and I/O statistics
+config BUSYBOX_CONFIG_LSOF
+       bool "lsof"
+       default n
+       help
+         Show open files in the format of:
+         PID <TAB> /path/to/executable <TAB> /path/to/opened/file
 config BUSYBOX_CONFIG_MPSTAT
        bool "mpstat"
        default n
@@ -146,12 +152,20 @@ config BUSYBOX_CONFIG_PS
 config BUSYBOX_CONFIG_FEATURE_PS_WIDE
        bool "Enable wide output option (-w)"
        default y
-       depends on BUSYBOX_CONFIG_PS
+       depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP
        help
          Support argument 'w' for wide output.
          If given once, 132 chars are printed, and if given more
          than once, the length is unlimited.
 
+config BUSYBOX_CONFIG_FEATURE_PS_LONG
+       bool "Enable long output option (-l)"
+       default n
+       depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP
+       help
+         Support argument 'l' for long output.
+         Adds fields PPID, RSS, START, TIME & TTY
+
 config BUSYBOX_CONFIG_FEATURE_PS_TIME
        bool "Enable time and elapsed time output"
        default n
diff --git a/package/busybox/config/runit/Config.in 
b/package/busybox/config/runit/Config.in
index 9d7c597..ed07c5a 100644
--- a/package/busybox/config/runit/Config.in
+++ b/package/busybox/config/runit/Config.in
@@ -7,7 +7,6 @@
 menu "Runit Utilities"
 
 
-
 config BUSYBOX_CONFIG_RUNSV
        bool "runsv"
        default n
diff --git a/package/busybox/config/selinux/Config.in 
b/package/busybox/config/selinux/Config.in
index e7317ca..d9e8397 100644
--- a/package/busybox/config/selinux/Config.in
+++ b/package/busybox/config/selinux/Config.in
@@ -8,7 +8,6 @@ menu "SELinux Utilities"
        depends on BUSYBOX_CONFIG_SELINUX
 
 
-
 config BUSYBOX_CONFIG_CHCON
        bool "chcon"
        default n
diff --git a/package/busybox/config/shell/Config.in 
b/package/busybox/config/shell/Config.in
index a271a38..c8e8eef 100644
--- a/package/busybox/config/shell/Config.in
+++ b/package/busybox/config/shell/Config.in
@@ -156,6 +156,9 @@ config BUSYBOX_CONFIG_CTTYHACK
 
          # exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
 
+         Starting getty on a controlling tty from a shell script:
+
+         # getty 115200 $(cttyhack)
 config BUSYBOX_CONFIG_HUSH
        bool "hush"
        default n
@@ -292,6 +295,7 @@ config BUSYBOX_CONFIG_MSH
          msh is deprecated and will be removed, please migrate to hush.
 
 
+
 choice
        prompt "Choose which shell is aliased to 'sh' name"
        default BUSYBOX_CONFIG_FEATURE_SH_IS_ASH
diff --git a/package/busybox/config/sysklogd/Config.in 
b/package/busybox/config/sysklogd/Config.in
index 20e1aff..2e9b9c6 100644
--- a/package/busybox/config/sysklogd/Config.in
+++ b/package/busybox/config/sysklogd/Config.in
@@ -7,7 +7,6 @@
 menu "System Logging Utilities"
 
 
-
 config BUSYBOX_CONFIG_SYSLOGD
        bool "syslogd"
        default y
diff --git a/package/busybox/config/util-linux/Config.in 
b/package/busybox/config/util-linux/Config.in
index 14d4777..de6a029 100644
--- a/package/busybox/config/util-linux/Config.in
+++ b/package/busybox/config/util-linux/Config.in
@@ -11,6 +11,63 @@ config BUSYBOX_CONFIG_BLOCKDEV
        default n
        help
          Performs some ioctls with block devices.
+config BUSYBOX_CONFIG_MDEV
+       bool "mdev"
+       default n
+       select BUSYBOX_CONFIG_PLATFORM_LINUX
+       help
+         mdev is a mini-udev implementation for dynamically creating device
+         nodes in the /dev directory.
+
+         For more information, please see docs/mdev.txt
+
+config BUSYBOX_CONFIG_FEATURE_MDEV_CONF
+       bool "Support /etc/mdev.conf"
+       default n
+       depends on BUSYBOX_CONFIG_MDEV
+       help
+         Add support for the mdev config file to control ownership and
+         permissions of the device nodes.
+
+         For more information, please see docs/mdev.txt
+
+config BUSYBOX_CONFIG_FEATURE_MDEV_RENAME
+       bool "Support subdirs/symlinks"
+       default n
+       depends on BUSYBOX_CONFIG_FEATURE_MDEV_CONF
+       help
+         Add support for renaming devices and creating symlinks.
+
+         For more information, please see docs/mdev.txt
+
+config BUSYBOX_CONFIG_FEATURE_MDEV_RENAME_REGEXP
+       bool "Support regular expressions substitutions when renaming device"
+       default n
+       depends on BUSYBOX_CONFIG_FEATURE_MDEV_RENAME
+       help
+         Add support for regular expressions substitutions when renaming
+         device.
+
+config BUSYBOX_CONFIG_FEATURE_MDEV_EXEC
+       bool "Support command execution at device addition/removal"
+       default n
+       depends on BUSYBOX_CONFIG_FEATURE_MDEV_CONF
+       help
+         This adds support for an optional field to /etc/mdev.conf for
+         executing commands when devices are created/removed.
+
+         For more information, please see docs/mdev.txt
+
+config BUSYBOX_CONFIG_FEATURE_MDEV_LOAD_FIRMWARE
+       bool "Support loading of firmwares"
+       default n
+       depends on BUSYBOX_CONFIG_MDEV
+       help
+         Some devices need to load firmware before they can be usable.
+
+         These devices will request userspace look up the files in
+         /lib/firmware/ and if it exists, send it to the kernel for
+         loading into the hardware.
 config BUSYBOX_CONFIG_REV
        bool "rev"
        default n
@@ -414,64 +471,6 @@ config BUSYBOX_CONFIG_LSUSB
 
          This version uses sysfs (/sys/bus/usb/devices) only.
 
-config BUSYBOX_CONFIG_MDEV
-       bool "mdev"
-       default n
-       select BUSYBOX_CONFIG_PLATFORM_LINUX
-       help
-         mdev is a mini-udev implementation for dynamically creating device
-         nodes in the /dev directory.
-
-         For more information, please see docs/mdev.txt
-
-config BUSYBOX_CONFIG_FEATURE_MDEV_CONF
-       bool "Support /etc/mdev.conf"
-       default n
-       depends on BUSYBOX_CONFIG_MDEV
-       help
-         Add support for the mdev config file to control ownership and
-         permissions of the device nodes.
-
-         For more information, please see docs/mdev.txt
-
-config BUSYBOX_CONFIG_FEATURE_MDEV_RENAME
-       bool "Support subdirs/symlinks"
-       default n
-       depends on BUSYBOX_CONFIG_FEATURE_MDEV_CONF
-       help
-         Add support for renaming devices and creating symlinks.
-
-         For more information, please see docs/mdev.txt
-
-config BUSYBOX_CONFIG_FEATURE_MDEV_RENAME_REGEXP
-       bool "Support regular expressions substitutions when renaming device"
-       default n
-       depends on BUSYBOX_CONFIG_FEATURE_MDEV_RENAME
-       help
-         Add support for regular expressions substitutions when renaming
-         device.
-
-config BUSYBOX_CONFIG_FEATURE_MDEV_EXEC
-       bool "Support command execution at device addition/removal"
-       default n
-       depends on BUSYBOX_CONFIG_FEATURE_MDEV_CONF
-       help
-         This adds support for an optional field to /etc/mdev.conf for
-         executing commands when devices are created/removed.
-
-         For more information, please see docs/mdev.txt
-
-config BUSYBOX_CONFIG_FEATURE_MDEV_LOAD_FIRMWARE
-       bool "Support loading of firmwares"
-       default n
-       depends on BUSYBOX_CONFIG_MDEV
-       help
-         Some devices need to load firmware before they can be usable.
-
-         These devices will request userspace look up the files in
-         /lib/firmware/ and if it exists, send it to the kernel for
-         loading into the hardware.
-
 config BUSYBOX_CONFIG_MKSWAP
        bool "mkswap"
        default n
@@ -553,13 +552,18 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_LABEL
          This also enables label or uuid support for swapon.
 
 config BUSYBOX_CONFIG_FEATURE_MOUNT_NFS
-       bool "Support mounting NFS file systems"
+       bool "Support mounting NFS file systems on Linux < 2.6.23"
        default n
        depends on BUSYBOX_CONFIG_MOUNT
        select BUSYBOX_CONFIG_FEATURE_HAVE_RPC
        select BUSYBOX_CONFIG_FEATURE_SYSLOG
        help
-         Enable mounting of NFS file systems.
+         Enable mounting of NFS file systems on Linux kernels prior
+         to version 2.6.23. Note that in this case mounting of NFS
+         over IPv6 will not be possible.
+
+         Note that this option links in RPC support from libc,
+         which is rather large (~10 kbytes on uclibc).
 
 config BUSYBOX_CONFIG_FEATURE_MOUNT_CIFS
        bool "Support mounting CIFS/SMB file systems"
diff --git 
a/package/busybox/patches/002-passwd_use_md5_hash_by_default_like_it_used_to_be.patch
 
b/package/busybox/patches/002-passwd_use_md5_hash_by_default_like_it_used_to_be.patch
deleted file mode 100644
index ff79f3e..0000000
--- 
a/package/busybox/patches/002-passwd_use_md5_hash_by_default_like_it_used_to_be.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-From eb80c2a5315ed08bd329448217695375d89732c9 Mon Sep 17 00:00:00 2001
-From: Nicolas Thill <[email protected]>
-Date: Wed, 9 Nov 2011 18:17:20 +0100
-Subject: [PATCH] passwd: use MD5 hash by default (like it used to be)
-
----
- loginutils/passwd.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
---- a/loginutils/passwd.c
-+++ b/loginutils/passwd.c
-@@ -94,7 +94,7 @@ int passwd_main(int argc UNUSED_PARAM, c
-       };
-       unsigned opt;
-       int rc;
--      const char *opt_a = "d"; /* des */
-+      const char *opt_a = "m"; /* md5 */
-       const char *filename;
-       char *myname;
-       char *name;
diff --git a/package/busybox/patches/004-upstream-percent_decode_in_place.patch 
b/package/busybox/patches/004-upstream-percent_decode_in_place.patch
deleted file mode 100644
index d94ee47..0000000
--- a/package/busybox/patches/004-upstream-percent_decode_in_place.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-http://git.busybox.net/busybox/commit/?id=dd1061b6a79b0161597799e825bfefc27993ace5
-
-From dd1061b6a79b0161597799e825bfefc27993ace5 Mon Sep 17 00:00:00 2001
-From: Denys Vlasenko <[email protected]>
-Date: Sun, 11 Sep 2011 21:04:02 +0200
-Subject: [PATCH] wget: URL-decode user:password before base64-encoding it into 
auth hdr. Closes 3625.
-
-function                                             old     new   delta
-percent_decode_in_place                                -     152    +152
-parse_url                                            304     317     +13
-handle_incoming_and_exit                            2795    2798      +3
-httpd_main                                           763     760      -3
-decodeString                                         152       -    -152
-------------------------------------------------------------------------------
-(add/remove: 2/1 grow/shrink: 2/1 up/down: 168/-155)           Total: 13 bytes
-
-Signed-off-by: Denys Vlasenko <[email protected]>
-
---- a/include/libbb.h
-+++ b/include/libbb.h
-@@ -1570,6 +1570,15 @@ int starts_with_cpu(const char *str) FAS
- unsigned get_cpu_count(void) FAST_FUNC;
- 
- 
-+/* Use strict=1 if you process input from untrusted source:
-+ * it will return NULL on invalid %xx (bad hex chars)
-+ * and str + 1 if decoded char is / or NUL.
-+ * In non-strict mode, it always succeeds (returns str),
-+ * and also it additionally decoded '+' to space.
-+ */
-+char *percent_decode_in_place(char *str, int strict) FAST_FUNC;
-+
-+
- extern const char bb_uuenc_tbl_base64[];
- extern const char bb_uuenc_tbl_std[];
- void bb_uuencode(char *store, const void *s, int length, const char *tbl) 
FAST_FUNC;
---- /dev/null
-+++ b/libbb/percent_decode.c
-@@ -0,0 +1,69 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
-+ */
-+
-+//kbuild:lib-y += percent_decode.o
-+
-+#include "libbb.h"
-+
-+static unsigned hex_to_bin(unsigned char c)
-+{
-+      unsigned v;
-+
-+      v = c - '0';
-+      if (v <= 9)
-+              return v;
-+      /* c | 0x20: letters to lower case, non-letters
-+       * to (potentially different) non-letters */
-+      v = (unsigned)(c | 0x20) - 'a';
-+      if (v <= 5)
-+              return v + 10;
-+      return ~0;
-+/* For testing:
-+void t(char c) { printf("'%c'(%u) %u\n", c, c, hex_to_bin(c)); }
-+int main() { t(0x10); t(0x20); t('0'); t('9'); t('A'); t('F'); t('a'); t('f');
-+t('0'-1); t('9'+1); t('A'-1); t('F'+1); t('a'-1); t('f'+1); return 0; }
-+*/
-+}
-+
-+char* FAST_FUNC percent_decode_in_place(char *str, int strict)
-+{
-+      /* note that decoded string is always shorter than original */
-+      char *src = str;
-+      char *dst = str;
-+      char c;
-+
-+      while ((c = *src++) != '\0') {
-+              unsigned v;
-+
-+              if (!strict && c == '+') {
-+                      *dst++ = ' ';
-+                      continue;
-+              }
-+              if (c != '%') {
-+                      *dst++ = c;
-+                      continue;
-+              }
-+              v = hex_to_bin(src[0]);
-+              if (v > 15) {
-+ bad_hex:
-+                      if (strict)
-+                              return NULL;
-+                      *dst++ = '%';
-+                      continue;
-+              }
-+              v = (v * 16) | hex_to_bin(src[1]);
-+              if (v > 255)
-+                      goto bad_hex;
-+              if (strict && (v == '/' || v == '\0')) {
-+                      /* caller takes it as indication of invalid
-+                       * (dangerous wrt exploits) chars */
-+                      return str + 1;
-+              }
-+              *dst++ = v;
-+              src += 2;
-+      }
-+      *dst = '\0';
-+      return str;
-+}
---- a/networking/httpd.c
-+++ b/networking/httpd.c
-@@ -820,78 +820,6 @@ static char *encodeString(const char *st
- }
- #endif
- 
--/*
-- * Given a URL encoded string, convert it to plain ascii.
-- * Since decoding always makes strings smaller, the decode is done in-place.
-- * Thus, callers should xstrdup() the argument if they do not want the
-- * argument modified.  The return is the original pointer, allowing this
-- * function to be easily used as arguments to other functions.
-- *
-- * string    The first string to decode.
-- * option_d  1 if called for httpd -d
-- *
-- * Returns a pointer to the decoded string (same as input).
-- */
--static unsigned hex_to_bin(unsigned char c)
--{
--      unsigned v;
--
--      v = c - '0';
--      if (v <= 9)
--              return v;
--      /* c | 0x20: letters to lower case, non-letters
--       * to (potentially different) non-letters */
--      v = (unsigned)(c | 0x20) - 'a';
--      if (v <= 5)
--              return v + 10;
--      return ~0;
--/* For testing:
--void t(char c) { printf("'%c'(%u) %u\n", c, c, hex_to_bin(c)); }
--int main() { t(0x10); t(0x20); t('0'); t('9'); t('A'); t('F'); t('a'); t('f');
--t('0'-1); t('9'+1); t('A'-1); t('F'+1); t('a'-1); t('f'+1); return 0; }
--*/
--}
--static char *decodeString(char *orig, int option_d)
--{
--      /* note that decoded string is always shorter than original */
--      char *string = orig;
--      char *ptr = string;
--      char c;
--
--      while ((c = *ptr++) != '\0') {
--              unsigned v;
--
--              if (option_d && c == '+') {
--                      *string++ = ' ';
--                      continue;
--              }
--              if (c != '%') {
--                      *string++ = c;
--                      continue;
--              }
--              v = hex_to_bin(ptr[0]);
--              if (v > 15) {
-- bad_hex:
--                      if (!option_d)
--                              return NULL;
--                      *string++ = '%';
--                      continue;
--              }
--              v = (v * 16) | hex_to_bin(ptr[1]);
--              if (v > 255)
--                      goto bad_hex;
--              if (!option_d && (v == '/' || v == '\0')) {
--                      /* caller takes it as indication of invalid
--                       * (dangerous wrt exploits) chars */
--                      return orig + 1;
--              }
--              *string++ = v;
--              ptr += 2;
--      }
--      *string = '\0';
--      return orig;
--}
--
- #if ENABLE_FEATURE_HTTPD_BASIC_AUTH
- /*
-  * Decode a base64 data stream as per rfc1521.
-@@ -1949,7 +1877,7 @@ static void handle_incoming_and_exit(con
-       }
- 
-       /* Decode URL escape sequences */
--      tptr = decodeString(urlcopy, 0);
-+      tptr = percent_decode_in_place(urlcopy, /*strict:*/ 1);
-       if (tptr == NULL)
-               send_headers_and_exit(HTTP_BAD_REQUEST);
-       if (tptr == urlcopy + 1) {
-@@ -2408,7 +2336,7 @@ int httpd_main(int argc UNUSED_PARAM, ch
-                       , &verbose
-               );
-       if (opt & OPT_DECODE_URL) {
--              fputs(decodeString(url_for_decode, 1), stdout);
-+              fputs(percent_decode_in_place(url_for_decode, /*strict:*/ 0), 
stdout);
-               return 0;
-       }
- #if ENABLE_FEATURE_HTTPD_ENCODE_URL_STR
---- a/networking/wget.c
-+++ b/networking/wget.c
-@@ -298,8 +298,13 @@ static void parse_url(const char *src_ur
- 
-       sp = strrchr(h->host, '@');
-       if (sp != NULL) {
--              h->user = h->host;
-+              // URL-decode "user:password" string before base64-encoding:
-+              // wget http://test:my%[email protected] should send
-+              // Authorization: Basic dGVzdDpteSBwYXNz
-+              // which decodes to "test:my pass".
-+              // Standard wget and curl do this too.
-               *sp = '\0';
-+              h->user = percent_decode_in_place(h->host, /*strict:*/ 0);
-               h->host = sp + 1;
-       }
- 
-@@ -661,12 +666,6 @@ static void download_one_url(const char
- 
- #if ENABLE_FEATURE_WGET_AUTHENTICATION
-               if (target.user) {
--//TODO: URL-decode "user:password" string before base64-encoding:
--//wget http://test:my%[email protected] should send
--// Authorization: Basic dGVzdDpteSBwYXNz
--//which decodes to "test:my pass", instead of what we send now:
--// Authorization: Basic dGVzdDpteSUyMHBhc3M=
--//Can reuse decodeString() from httpd.c
-                       fprintf(sfp, "Proxy-Authorization: Basic %s\r\n"+6,
-                               base64enc(target.user));
-               }
diff --git a/package/busybox/patches/241-udhcpc-oversized_packets.patch 
b/package/busybox/patches/241-udhcpc-oversized_packets.patch
index 471d704..0ad5f3f 100644
--- a/package/busybox/patches/241-udhcpc-oversized_packets.patch
+++ b/package/busybox/patches/241-udhcpc-oversized_packets.patch
@@ -1,7 +1,9 @@
+diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
+index 33c9585..e2cef85 100644
 --- a/networking/udhcp/packet.c
 +++ b/networking/udhcp/packet.c
-@@ -158,6 +158,11 @@ uint16_t FAST_FUNC udhcp_checksum(void *
-       return ~sum;
+@@ -101,6 +101,11 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcp_packet 
*packet, int fd)
+       return bytes;
  }
  
 +int udhcp_get_payload_len(struct dhcp_packet *dhcp_pkt)
@@ -12,7 +14,7 @@
  /* Construct a ip/udp header for a packet, send packet */
  int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt,
                uint32_t source_nip, int source_port,
-@@ -166,10 +171,10 @@ int FAST_FUNC udhcp_send_raw_packet(stru
+@@ -109,10 +114,10 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet 
*dhcp_pkt,
  {
        struct sockaddr_ll dest_sll;
        struct ip_udp_dhcp_packet packet;
@@ -24,7 +26,7 @@
  
        fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
        if (fd < 0) {
-@@ -178,8 +183,8 @@ int FAST_FUNC udhcp_send_raw_packet(stru
+@@ -121,8 +126,8 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet 
*dhcp_pkt,
        }
  
        memset(&dest_sll, 0, sizeof(dest_sll));
@@ -35,7 +37,7 @@
  
        dest_sll.sll_family = AF_PACKET;
        dest_sll.sll_protocol = htons(ETH_P_IP);
-@@ -192,36 +197,24 @@ int FAST_FUNC udhcp_send_raw_packet(stru
+@@ -135,37 +140,24 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet 
*dhcp_pkt,
                goto ret_close;
        }
  
@@ -61,16 +63,17 @@
 +      p_len += sizeof(packet.udp);
 +      packet.udp.len = htons(p_len);
        packet.ip.tot_len = packet.udp.len;
--      packet.udp.check = udhcp_checksum(&packet, IP_UDP_DHCP_SIZE - padding);
+-      packet.udp.check = inet_cksum((uint16_t *)&packet,
+-                      IP_UDP_DHCP_SIZE - padding);
 -      /* but for sending, it is set to IP packet len */
 -      packet.ip.tot_len = htons(IP_UDP_DHCP_SIZE - padding);
 +      p_len += sizeof(packet.ip);
-+      packet.udp.check = udhcp_checksum(&packet, p_len);
++      packet.udp.check = inet_cksum((uint16_t *)&packet, p_len);
 +      packet.ip.tot_len = htons(p_len);
        packet.ip.ihl = sizeof(packet.ip) >> 2;
        packet.ip.version = IPVERSION;
        packet.ip.ttl = IPDEFTTL;
-       packet.ip.check = udhcp_checksum(&packet.ip, sizeof(packet.ip));
+       packet.ip.check = inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip));
  
        udhcp_dump_packet(dhcp_pkt);
 -      result = sendto(fd, &packet, IP_UDP_DHCP_SIZE - padding, /*flags:*/ 0,
@@ -78,19 +81,18 @@
                        (struct sockaddr *) &dest_sll, sizeof(dest_sll));
        msg = "sendto";
   ret_close:
-@@ -239,7 +232,6 @@ int FAST_FUNC udhcp_send_kernel_packet(s
+@@ -183,7 +175,6 @@ int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet 
*dhcp_pkt,
                uint32_t dest_nip, int dest_port)
  {
-       struct sockaddr_in client;
+       struct sockaddr_in sa;
 -      unsigned padding;
        int fd;
        int result = -1;
        const char *msg;
-@@ -270,9 +262,7 @@ int FAST_FUNC udhcp_send_kernel_packet(s
+@@ -214,8 +205,7 @@ int FAST_FUNC udhcp_send_kernel_packet(struct dhcp_packet 
*dhcp_pkt,
        }
  
        udhcp_dump_packet(dhcp_pkt);
--
 -      padding = DHCP_OPTIONS_BUFSIZE - 1 - 
udhcp_end_option(dhcp_pkt->options);
 -      result = safe_write(fd, dhcp_pkt, DHCP_SIZE - padding);
 +      result = safe_write(fd, dhcp_pkt, udhcp_get_payload_len(dhcp_pkt));
diff --git a/package/busybox/patches/244-udhcpc_add_6rd_option.patch 
b/package/busybox/patches/244-udhcpc_add_6rd_option.patch
index 9e30ef7..e17f74b 100644
--- a/package/busybox/patches/244-udhcpc_add_6rd_option.patch
+++ b/package/busybox/patches/244-udhcpc_add_6rd_option.patch
@@ -1,143 +1,24 @@
+diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
+index ae0e0d3..147e176 100644
 --- a/networking/udhcp/common.c
 +++ b/networking/udhcp/common.c
-@@ -60,6 +60,8 @@ const struct dhcp_optflag dhcp_optflags[
+@@ -62,7 +62,8 @@ const struct dhcp_optflag dhcp_optflags[] = {
+       { OPTION_U16                              , 0x84 }, /* DHCP_VLAN_ID     
  */
        { OPTION_U8                               , 0x85 }, /* 
DHCP_VLAN_PRIORITY */
  #endif
-       { OPTION_STATIC_ROUTES                    , 0xf9 }, /* 
DHCP_MS_STATIC_ROUTES */
+-      { OPTION_6RD                              , 0xd4 }, /* DHCP_6RD         
  */
 +      { OPTION_6RD                              , 0xd4 }, /* DHCP_6RD (RFC)   
  */
 +      { OPTION_6RD                              , 0x96 }, /* DHCP_6RD 
(Comcast) */
+       { OPTION_STATIC_ROUTES | OPTION_LIST      , 0xf9 }, /* 
DHCP_MS_STATIC_ROUTES */
        { OPTION_STRING                           , 0xfc }, /* DHCP_WPAD        
  */
  
-       /* Options below have no match in dhcp_option_strings[],
-@@ -127,6 +129,8 @@ const char dhcp_option_strings[] ALIGN1
+@@ -128,7 +129,8 @@ const char dhcp_option_strings[] ALIGN1 =
+       "vlanid" "\0"      /* DHCP_VLAN_ID        */
        "vlanpriority" "\0"/* DHCP_VLAN_PRIORITY  */
  #endif
+-      "ip6rd" "\0"       /* DHCP_6RD            */
++      "ip6rd" "\0"       /* DHCP_6RD (RFC)        */
++      "ip6rd" "\0"       /* DHCP_6RD (Comcast)    */
        "msstaticroutes""\0"/* DHCP_MS_STATIC_ROUTES */
-+      "ip6rd" "\0"       /* DHCP_6RD (RFC)      */
-+      "ip6rd" "\0"       /* DHCP_6RD (Comcast)  */
        "wpad" "\0"        /* DHCP_WPAD           */
        ;
- 
-@@ -154,6 +158,7 @@ const uint8_t dhcp_option_lengths[] ALIG
-       [OPTION_S32] =     4,
-       /* Just like OPTION_STRING, we use minimum length here */
-       [OPTION_STATIC_ROUTES] = 5,
-+      [OPTION_6RD]           = 22,
- };
- 
- 
---- a/networking/udhcp/common.h
-+++ b/networking/udhcp/common.h
-@@ -88,6 +88,7 @@ enum {
-       OPTION_S32,
-       OPTION_BIN,
-       OPTION_STATIC_ROUTES,
-+      OPTION_6RD,
- #if ENABLE_FEATURE_UDHCP_RFC3397
-       OPTION_DNS_STRING,  /* RFC1035 compressed domain name list */
-       OPTION_SIP_SERVERS,
---- a/networking/udhcp/dhcpc.c
-+++ b/networking/udhcp/dhcpc.c
-@@ -100,6 +100,7 @@ static const uint8_t len_of_option_as_st
-       [OPTION_IP              ] = sizeof("255.255.255.255 "),
-       [OPTION_IP_PAIR         ] = sizeof("255.255.255.255 ") * 2,
-       [OPTION_STATIC_ROUTES   ] = sizeof("255.255.255.255/32 255.255.255.255 
"),
-+      [OPTION_6RD             ] = sizeof("32 128 
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 255.255.255.255 "),
-       [OPTION_STRING          ] = 1,
- #if ENABLE_FEATURE_UDHCP_RFC3397
-       [OPTION_DNS_STRING      ] = 1, /* unused */
-@@ -123,6 +124,23 @@ static int sprint_nip(char *dest, const
-       return sprintf(dest, "%s%u.%u.%u.%u", pre, ip[0], ip[1], ip[2], ip[3]);
- }
- 
-+static int sprint_nip6(char *dest, const char *pre, const uint8_t *ip)
-+{
-+      int len = 0;
-+      int off;
-+      uint16_t word;
-+
-+      len += sprintf(dest, "%s", pre);
-+
-+      for (off = 0; off < 16; off += 2)
-+      {
-+              move_from_unaligned16(word, &ip[off]);
-+              len += sprintf(dest+len, "%s%04X", off ? ":" : "", htons(word));
-+      }
-+
-+      return len;
-+}
-+
- /* really simple implementation, just count the bits */
- static int mton(uint32_t mask)
- {
-@@ -231,6 +249,70 @@ static NOINLINE char *xmalloc_optname_op
-                       }
- 
-                       return ret;
-+              }
-+              case OPTION_6RD: {
-+                      /* Option binary format:
-+                       *  0                   1                   2           
        3
-+                       *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 
6 7 8 9 0 1
-+                       *  
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-+                       *  |  OPTION_6RD   | option-length |  IPv4MaskLen  |  
6rdPrefixLen |
-+                       *  
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-+                       *  |                                                   
            |
-+                       *  |                           6rdPrefix               
            |
-+                       *  |                          (16 octets)              
            |
-+                       *  |                                                   
            |
-+                       *  |                                                   
            |
-+                       *  |                                                   
            |
-+                       *  
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-+                       *  |                     6rdBRIPv4Address(es)          
            |
-+                       *  .                                                   
            .
-+                       *  .                                                   
            .
-+                       *  .                                                   
            .
-+                       *  
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-+                       *
-+                       * We convert it to a string "IPv4MaskLen 6rdPrefixLen 
6rdPrefix 6rdBRIPv4Address"
-+                       */
-+
-+                      /* Sanity check: ensure that our length is at least 22 
bytes, that
-+                       * IPv4MaskLen is <= 32, 6rdPrefixLen <= 128 and that 
the sum of
-+                       * (32 - IPv4MaskLen) + 6rdPrefixLen is less than or 
equal to 128.
-+                       * If any of these requirements is not fulfilled, 
return with empty
-+                       * value.
-+                       */
-+                      if ((len >= 22) && (*option <= 32) && (*(option+1) <= 
128) &&
-+                          (((32 - *option) + *(option+1)) <= 128))
-+                      {
-+                              /* IPv4MaskLen */
-+                              dest += sprintf(dest, "%u ", *option++);
-+                              len--;
-+
-+                              /* 6rdPrefixLen */
-+                              dest += sprintf(dest, "%u ", *option++);
-+                              len--;
-+
-+                              /* 6rdPrefix */
-+                              dest += sprint_nip6(dest, "", option);
-+                              option += 16;
-+                              len -= 16;
-+
-+                              /* 6rdBRIPv4Addresses */
-+                              while (len >= 4)
-+                              {
-+                                      dest += sprint_nip(dest, " ", option);
-+                                      option += 4;
-+                                      len -= 4;
-+
-+                                      /* the code to determine the option 
size fails to work with
-+                                       * lengths that are not a multiple of 
the minimum length,
-+                                       * adding all advertised 
6rdBRIPv4Addresses here would
-+                                       * overflow the destination buffer, 
therefore skip the rest
-+                                       * for now
-+                                       */
-+                                      break;
-+                              }
-+                      }
-+
-+                      return ret;
-               }
- #if ENABLE_FEATURE_UDHCP_RFC3397
-               case OPTION_DNS_STRING:
diff --git a/package/busybox/patches/310-passwd_access.patch 
b/package/busybox/patches/310-passwd_access.patch
deleted file mode 100644
index daa1b99..0000000
--- a/package/busybox/patches/310-passwd_access.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-
-       Copyright (C) 2006 OpenWrt.org
-
---- a/networking/httpd.c
-+++ b/networking/httpd.c
-@@ -1700,21 +1700,32 @@ static int check_user_passwd(const char
- 
-               if (ENABLE_FEATURE_HTTPD_AUTH_MD5) {
-                       char *md5_passwd;
-+                      int user_len_p1;
- 
-                       md5_passwd = strchr(cur->after_colon, ':');
--                      if (md5_passwd && md5_passwd[1] == '$' && md5_passwd[2] 
== '1'
-+                      user_len_p1 = md5_passwd + 1 - cur->after_colon;
-+                      if (md5_passwd && !strncmp(md5_passwd + 1, "$p$", 3)) {
-+                              struct passwd *pwd = NULL;
-+
-+                              pwd = getpwnam(&md5_passwd[4]);
-+                              if(!pwd->pw_passwd || !pwd->pw_passwd[0] || 
pwd->pw_passwd[0] == '!')
-+                                      return 1;
-+
-+                              md5_passwd = pwd->pw_passwd;
-+                              goto check_md5_pw;
-+                      } else if (md5_passwd && md5_passwd[1] == '$' && 
md5_passwd[2] == '1'
-                        && md5_passwd[3] == '$' && md5_passwd[4]
-                       ) {
-                               char *encrypted;
--                              int r, user_len_p1;
-+                              int r;
- 
-                               md5_passwd++;
--                              user_len_p1 = md5_passwd - cur->after_colon;
-                               /* comparing "user:" */
-                               if (strncmp(cur->after_colon, user_and_passwd, 
user_len_p1) != 0) {
-                                       continue;
-                               }
- 
-+check_md5_pw:
-                               encrypted = pw_encrypt(
-                                       user_and_passwd + user_len_p1 /* 
cleartext pwd from user */,
-                                       md5_passwd /*salt */, 1 /* cleanup */);
diff --git a/package/busybox/patches/350-httpd_redir.patch 
b/package/busybox/patches/350-httpd_redir.patch
index 11125e7..b03fe98 100644
--- a/package/busybox/patches/350-httpd_redir.patch
+++ b/package/busybox/patches/350-httpd_redir.patch
@@ -1,6 +1,8 @@
+diff --git a/networking/httpd.c b/networking/httpd.c
+index 12218a0..0d60bd7 100644
 --- a/networking/httpd.c
 +++ b/networking/httpd.c
-@@ -105,6 +105,7 @@
+@@ -107,6 +107,7 @@
  //usage:      IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]")
  //usage:       " [-h HOME]\n"
  //usage:       "or httpd -d/-e" IF_FEATURE_HTTPD_AUTH_MD5("/-m") " STRING"
@@ -8,16 +10,15 @@
  //usage:#define httpd_full_usage "\n\n"
  //usage:       "Listen for incoming HTTP requests\n"
  //usage:     "\n      -i              Inetd mode"
-@@ -121,6 +122,8 @@
+@@ -123,6 +124,7 @@
  //usage:     "\n      -m STRING       MD5 crypt STRING")
  //usage:     "\n      -e STRING       HTML encode STRING"
  //usage:     "\n      -d STRING       URL decode STRING"
-+//usage:     "\n      -R PATH         Redirect target path"
 +//usage:     "\n      -H HOST         Redirect target host"
  
  #include "libbb.h"
- #if ENABLE_FEATURE_HTTPD_USE_SENDFILE
-@@ -272,6 +275,8 @@ struct globals {
+ #if ENABLE_PAM
+@@ -282,6 +284,8 @@ struct globals {
  
        const char *found_mime_type;
        const char *found_moved_temporarily;
@@ -26,7 +27,7 @@
        Htaccess_IP *ip_a_d;    /* config allow/deny lines */
  
        IF_FEATURE_HTTPD_BASIC_AUTH(const char *g_realm;)
-@@ -322,6 +327,8 @@ struct globals {
+@@ -332,6 +336,8 @@ struct globals {
  #define index_page        (G.index_page       )
  #define found_mime_type   (G.found_mime_type  )
  #define found_moved_temporarily (G.found_moved_temporarily)
@@ -35,7 +36,7 @@
  #define last_mod          (G.last_mod         )
  #define ip_a_d            (G.ip_a_d           )
  #define g_realm           (G.g_realm          )
-@@ -956,8 +963,11 @@ static void send_headers(int responseNum
+@@ -967,8 +973,11 @@ static void send_headers(int responseNum)
        }
  #endif
        if (responseNum == HTTP_MOVED_TEMPORARILY) {
@@ -48,9 +49,9 @@
                                (g_query ? "?" : ""),
                                (g_query ? g_query : ""));
        }
-@@ -1925,8 +1935,12 @@ static void handle_incoming_and_exit(con
-       } while (*++tptr);
-       *++urlp = '\0';       /* terminate after last character */
+@@ -2056,8 +2065,12 @@ static void handle_incoming_and_exit(const 
len_and_sockaddr *fromAddr)
+               tptr++;
+       }
  
 +      /* redirect active */
 +      if (redirect_path && (strncmp(urlcopy, redirect_path, 
strlen(redirect_path)) != 0))
@@ -59,10 +60,10 @@
        /* If URL is a directory, add '/' */
 -      if (urlp[-1] != '/') {
 +      if (!redirect_path && (urlp[-1] != '/')) {
-               if (is_directory(urlcopy + 1, 1, NULL)) {
+               if (is_directory(urlcopy + 1, /*followlinks:*/ 1)) {
                        found_moved_temporarily = urlcopy;
                }
-@@ -2283,7 +2297,9 @@ static void sighup_handler(int sig UNUSE
+@@ -2422,7 +2435,9 @@ static void sighup_handler(int sig UNUSED_PARAM)
  }
  
  enum {
@@ -73,7 +74,7 @@
        d_opt_decode_url,
        h_opt_home_httpd,
        IF_FEATURE_HTTPD_ENCODE_URL_STR(e_opt_encode_url,)
-@@ -2332,12 +2348,13 @@ int httpd_main(int argc UNUSED_PARAM, ch
+@@ -2471,12 +2486,13 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
        /* We do not "absolutize" path given by -h (home) opt.
         * If user gives relative path in -h,
         * $SCRIPT_FILENAME will not be set. */
diff --git a/package/busybox/patches/700-hexdump_segfault_fix.patch 
b/package/busybox/patches/700-hexdump_segfault_fix.patch
deleted file mode 100644
index ab09fb3..0000000
--- a/package/busybox/patches/700-hexdump_segfault_fix.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libbb/dump.c
-+++ b/libbb/dump.c
-@@ -301,7 +301,7 @@ static NOINLINE void rewrite(priv_dumper
-               ) {
-                       fu->reps += (dumper->blocksize - fs->bcnt) / fu->bcnt;
-               }
--              if (fu->reps > 1) {
-+              if (fu->reps > 1 && fu->nextpr) {
-                       for (pr = fu->nextpr;; pr = pr->nextpr)
-                               if (!pr->nextpr)
-                                       break;
-- 
1.7.10

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to