summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2017-08-01 09:45:50 +0200
committerLars Wendler <polynomial-c@gentoo.org>2017-08-01 09:46:05 +0200
commitba88569985ba83cd2fd5035028ee599fca26f622 (patch)
tree2a347c4acf4e22e016377ccebdc4644e818703b5 /net-misc/dhcp/files
parentapp-admin/r10k: fix various issues (diff)
downloadgentoo-ba88569985ba83cd2fd5035028ee599fca26f622.tar.gz
gentoo-ba88569985ba83cd2fd5035028ee599fca26f622.tar.bz2
gentoo-ba88569985ba83cd2fd5035028ee599fca26f622.zip
net-misc/dhcp: Bump to version 4.3.6
Package-Manager: Portage-2.3.6, Repoman-2.3.3 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'net-misc/dhcp/files')
-rw-r--r--net-misc/dhcp/files/dhcp-3.0-fix-perms.patch4
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch4
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch210
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch422
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch11
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch66
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch66
7 files changed, 779 insertions, 4 deletions
diff --git a/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch b/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
index 13debb20ed0e..f4b3fd18e167 100644
--- a/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
+++ b/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
@@ -1,5 +1,5 @@
---- server/dhcpd.c 2003-11-05 14:08:09.000000000 -0800
-+++ server/dhcpd.c 2003-11-05 14:15:32.000000000 -0800
+--- a/server/dhcpd.c
++++ b/server/dhcpd.c
@@ -602,6 +602,12 @@
if (lftest)
exit (0);
diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
index 518efec11c53..3a3b956e3616 100644
--- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
@@ -1,5 +1,5 @@
---- client/scripts/linux
-+++ client/scripts/linux
+--- a/client/scripts/linux
++++ b/client/scripts/linux
@@ -118,9 +118,9 @@
if [ x$reason = xPREINIT ]; then
if [ x$alias_ip_address != x ]; then
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch
new file mode 100644
index 000000000000..a504840dd5ab
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch
@@ -0,0 +1,210 @@
+--- dhcp-4.3.6/client/clparse.c
++++ dhcp-4.3.6/client/clparse.c
+@@ -31,7 +31,7 @@
+
+ struct client_config top_level_config;
+
+-#define NUM_DEFAULT_REQUESTED_OPTS 9
++#define NUM_DEFAULT_REQUESTED_OPTS 10
+ /* There can be 2 extra requested options for DHCPv4-over-DHCPv6. */
+ struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 2 + 1];
+
+@@ -107,15 +107,20 @@
+ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 8 */
+- code = D6O_NAME_SERVERS;
++ code = DHO_NTP_SERVERS;
+ option_code_hash_lookup(&default_requested_options[7],
+- dhcpv6_universe.code_hash, &code, 0, MDL);
++ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 9 */
+- code = D6O_DOMAIN_SEARCH;
++ code = D6O_NAME_SERVERS;
+ option_code_hash_lookup(&default_requested_options[8],
+ dhcpv6_universe.code_hash, &code, 0, MDL);
+
++ /* 10 */
++ code = D6O_DOMAIN_SEARCH;
++ option_code_hash_lookup(&default_requested_options[9],
++ dhcpv6_universe.code_hash, &code, 0, MDL);
++
+ for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
+ if (default_requested_options[code] == NULL)
+ log_fatal("Unable to find option definition for "
+--- dhcp-4.3.6/client/scripts/bsdos
++++ dhcp-4.3.6/client/scripts/bsdos
+@@ -36,6 +36,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ x$new_ntp_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/freebsd
++++ dhcp-4.3.6/client/scripts/freebsd
+@@ -80,6 +80,26 @@
+ fi
+ fi
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -106,6 +106,27 @@
+ fi
+ mv -f $new_resolv_conf /etc/resolv.conf
+ fi
++
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # set host name
+--- dhcp-4.3.6/client/scripts/netbsd
++++ dhcp-4.3.6/client/scripts/netbsd
+@@ -36,6 +36,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/openbsd
++++ dhcp-4.3.6/client/scripts/openbsd
+@@ -36,6 +36,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/solaris
++++ dhcp-4.3.6/client/scripts/solaris
+@@ -17,6 +17,26 @@
+
+ mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch
new file mode 100644
index 000000000000..ccfdbcf4a206
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch
@@ -0,0 +1,422 @@
+--- dhcp-4.3.6/client/scripts/bsdos
++++ dhcp-4.3.6/client/scripts/bsdos
+@@ -1,27 +1,25 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+ if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >> /etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+@@ -31,10 +29,18 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/freebsd
++++ dhcp-4.3.6/client/scripts/freebsd
+@@ -11,54 +11,23 @@
+ fi
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient )
+- exit_status=$?
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
+- else
+- if [ "x$new_domain_search" != x ]; then
+- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- elif [ "x$new_domain_name" != x ]; then
+- # Note that the DHCP 'Domain Name Option' is really just a domain
+- # name, and that this practice of using the domain name option as
+- # a search path is both nonstandard and deprecated.
+- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- fi
+- for nameserver in $new_domain_name_servers; do
+- if [ $exit_status -ne 0 ]; then
+- break
+- fi
+- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
+- exit_status=$?
+- done
+-
+- # If there were no errors, attempt to mv the new file into place.
+- if [ $exit_status -eq 0 ]; then
+- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
+- exit_status=$?
+- fi
+-
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
++ # Note that the DHCP 'Domain Name Option' is really just a domain
++ # name, and that this practice of using the domain name option as
++ # a search path is both nonstandard and deprecated.
++ conf="${conf}search ${new_domain_name}\n"
+ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver ${nameserver}\n"
++ done
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status"
+- else
+- if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- fi
+- for nameserver in ${new_dhcp6_name_servers} ; do
+- if [ $exit_status -ne 0 ] ; then
+- break
+- fi
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+@@ -66,18 +35,21 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- ( echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- done
+-
+- if [ $exit_status -eq 0 ] ; then
+- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf )
+- exit_status=$?
+- fi
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
++ done
++ fi
+
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
+ fi
+ fi
+ }
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -35,16 +35,16 @@
+ # update /etc/resolv.conf based on received values
+ # This updated version mostly follows Debian script by Andrew Pollock et al.
+ make_resolv_conf() {
+- local new_resolv_conf
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf
+
+ # DHCPv4
+ if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
+ [ -n "$new_domain_name_servers" ]; then
+- new_resolv_conf=/etc/resolv.conf.dhclient-new
+- rm -f $new_resolv_conf
+-
+ if [ -n "$new_domain_name" ]; then
+- echo domain ${new_domain_name%% *} >>$new_resolv_conf
++ conf="${conf}domain ${new_domain_name%% *}\n"
+ fi
+
+ if [ -n "$new_domain_search" ]; then
+@@ -60,31 +60,23 @@
+ new_domain_search="$new_domain_name $new_domain_search"
+ fi
+ fi
+- echo "search ${new_domain_search}" >> $new_resolv_conf
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ -n "$new_domain_name" ]; then
+- echo "search ${new_domain_name}" >> $new_resolv_conf
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+
+ if [ -n "$new_domain_name_servers" ]; then
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>$new_resolv_conf
++ conf="${conf}nameserver $nameserver\n"
+ done
+ else # keep 'old' nameservers
+- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
++ conf="${conf}$(sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf)\n"
+ fi
+
+- if [ -f /etc/resolv.conf ]; then
+- chown --reference=/etc/resolv.conf $new_resolv_conf
+- chmod --reference=/etc/resolv.conf $new_resolv_conf
+- fi
+- mv -f $new_resolv_conf /etc/resolv.conf
+ # DHCPv6
+ elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then
+- new_resolv_conf=/etc/resolv.conf.dhclient-new
+- rm -f $new_resolv_conf
+-
+ if [ -n "$new_dhcp6_domain_search" ]; then
+- echo "search ${new_dhcp6_domain_search}" >> $new_resolv_conf
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+
+ if [ -n "$new_dhcp6_name_servers" ]; then
+@@ -94,17 +86,21 @@
+ [ "${nameserver##FE80::}" != "$nameserver" ]; then
+ nameserver="${nameserver}%${interface}"
+ fi
+- echo nameserver $nameserver >>$new_resolv_conf
++ conf="${conf}nameserver $nameserver\n"
+ done
+ else # keep 'old' nameservers
+- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
++ conf="${conf}$(sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf)\n"
+ fi
++ fi
+
+- if [ -f /etc/resolv.conf ]; then
+- chown --reference=/etc/resolv.conf $new_resolv_conf
+- chmod --reference=/etc/resolv.conf $new_resolv_conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
+ fi
+- mv -f $new_resolv_conf /etc/resolv.conf
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/netbsd
++++ dhcp-4.3.6/client/scripts/netbsd
+@@ -1,27 +1,25 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
+- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
++ if [ x"$new_domain_name_servers" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+@@ -31,10 +29,18 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/openbsd
++++ dhcp-4.3.6/client/scripts/openbsd
+@@ -1,27 +1,25 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+@@ -31,10 +29,18 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/solaris
++++ dhcp-4.3.6/client/scripts/solaris
+@@ -1,21 +1,39 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
++ done
++ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch b/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch
new file mode 100644
index 000000000000..18b04e620c14
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch
@@ -0,0 +1,11 @@
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -30,7 +30,7 @@
+ # 'ip' just looks too weird. Also, we now have unit-tests! Those unit-tests
+ # overwirte this line to use a fake ip-echo tool. It's also convenient
+ # if your system holds ip tool in a non-standard location.
+-ip=/sbin/ip
++ip=ip
+
+ # update /etc/resolv.conf based on received values
+ # This updated version mostly follows Debian script by Andrew Pollock et al.
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch b/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch
new file mode 100644
index 000000000000..d299cc503f60
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch
@@ -0,0 +1,66 @@
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -242,20 +242,22 @@
+ if_metric=${if_metric:-1}
+ fi
+
+- for router in $new_routers; do
+- if [ "$new_subnet_mask" = "255.255.255.255" ]; then
+- # point-to-point connection => set explicit route
+- ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
+- fi
+-
+- # set default route
+- ${ip} -4 route add default via ${router} dev ${interface} \
+- ${if_metric:+metric $if_metric} >/dev/null 2>&1
+-
+- if [ -n "$if_metric" ]; then
+- if_metric=$((if_metric+1))
+- fi
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ for router in $new_routers; do
++ if [ "$new_subnet_mask" = "255.255.255.255" ]; then
++ # point-to-point connection => set explicit route
++ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
++ fi
++
++ # set default route
++ ${ip} -4 route add default via ${router} dev ${interface} \
++ ${if_metric:+metric $if_metric} >/dev/null 2>&1
++
++ if [ -n "$if_metric" ]; then
++ if_metric=$((if_metric+1))
++ fi
++ done
++ fi
+ fi
+ fi
+
+@@ -330,15 +332,17 @@
+ if_metric=${if_metric:-1}
+ fi
+
+- # set default route
+- for router in $new_routers; do
+- ${ip} -4 route add default via ${router} dev ${interface} \
+- ${if_metric:+metric $if_metric} >/dev/null 2>&1
+-
+- if [ -n "$if_metric" ]; then
+- if_metric=$((if_metric+1))
+- fi
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ # set default route
++ for router in $new_routers; do
++ ${ip} -4 route add default via ${router} dev ${interface} \
++ ${if_metric:+metric $if_metric} >/dev/null 2>&1
++
++ if [ -n "$if_metric" ]; then
++ if_metric=$((if_metric+1))
++ fi
++ done
++ fi
+ fi
+
+ # update /etc/resolv.conf
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch b/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch
new file mode 100644
index 000000000000..3efb6459ebf9
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch
@@ -0,0 +1,66 @@
+--- dhcp-4.3.6/client/scripts/bsdos
++++ dhcp-4.3.6/client/scripts/bsdos
+@@ -220,7 +220,7 @@
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/freebsd
++++ dhcp-4.3.6/client/scripts/freebsd
+@@ -287,7 +287,7 @@
+ if [ -n "$new_routers" ]; then
+ $LOGGER "New Routers: $new_routers"
+ set -- $new_routers
+- if ping -q -c 1 $1; then
++ if ping -q -c 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -311,7 +311,7 @@
+ fi
+
+ # if there is no router recorded in the lease or the 1st router answers pings
+- if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}"; then
++ if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}" >/dev/null; then
+ # if we have $new_rfc3442_classless_static_routes then we have to
+ # ignore $new_routers entirely
+ if [ ! "$new_rfc3442_classless_static_routes" ]; then
+--- dhcp-4.3.6/client/scripts/netbsd
++++ dhcp-4.3.6/client/scripts/netbsd
+@@ -220,7 +220,7 @@
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/openbsd
++++ dhcp-4.3.6/client/scripts/openbsd
+@@ -214,7 +214,7 @@
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/openwrt
++++ dhcp-4.3.6/client/scripts/openwrt
+@@ -190,7 +190,7 @@
+ ifconfig $interface $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg
+ set $new_routers
+- if ping -q -c 1 $1; then
++ if ping -q -c 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface:0 $alias_ip_address $alias_subnet_arg