Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
Date: Tue, 01 Aug 2017 07:46:11
Message-Id: 1501573565.ba88569985ba83cd2fd5035028ee599fca26f622.polynomial-c@gentoo
1 commit: ba88569985ba83cd2fd5035028ee599fca26f622
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 1 07:45:50 2017 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 1 07:46:05 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba885699
7
8 net-misc/dhcp: Bump to version 4.3.6
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.3
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 net-misc/dhcp/Manifest | 1 +
14 net-misc/dhcp/dhcp-4.3.6.ebuild | 262 +++++++++++++
15 net-misc/dhcp/files/dhcp-3.0-fix-perms.patch | 4 +-
16 .../dhcp/files/dhcp-3.0.3-dhclient-no-down.patch | 4 +-
17 net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch | 210 ++++++++++
18 .../files/dhcp-4.3.6-dhclient-resolvconf.patch | 422 +++++++++++++++++++++
19 net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch | 11 +
20 net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch | 66 ++++
21 net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch | 66 ++++
22 9 files changed, 1042 insertions(+), 4 deletions(-)
23
24 diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
25 index 3341a295d95..075efb60c20 100644
26 --- a/net-misc/dhcp/Manifest
27 +++ b/net-misc/dhcp/Manifest
28 @@ -1,2 +1,3 @@
29 DIST dhcp-4.3.4.tar.gz 9302513 SHA256 f5115aee3dd3e6925de4ba47b80ab732ba48b481c8364b6ebade2d43698d607e SHA512 411c3f0e1effedb2a95f00539d13164530a56b50830008eb78906b3c8bf4070c331cf54a431770aed5d1b6ba214840446964210060674f746781cc97842ad706 WHIRLPOOL ea283592268c8efabd7fec430bd21c45306822b9275c91ee1e604d09e92f9eb3c50941ea11ecd9dcb230caec3b8e6ee94958e8eb6375e0ca0e7a64a8aaf63bce
30 DIST dhcp-4.3.5.tar.gz 10075147 SHA256 eb95936bf15d2393c55dd505bc527d1d4408289cec5a9fa8abb99f7577e7f954 SHA512 aba0e1d361eb9e7ed33fc48c0b0b9288057af9ec51775e40e27feb9ababc182506706fcf39079236ce36b0f7ded391e107474dc29de2e60ed45d37753505e1f0 WHIRLPOOL 85012016d81efb7654ec417e7a0f1a6145e8e143b13d6d9470d0fb7caf37c035441d5b2b8849d332f8ad0a9a6509bb0b931ac8f207f7ba9104e96811c0360124
31 +DIST dhcp-4.3.6.tar.gz 10182593 SHA256 a41eaf6364f1377fe065d35671d9cf82bbbc8f21207819b2b9f33f652aec6f1b SHA512 de4962dc2aa174df17a3a1456719a777a42d238c3d6ad1771ccc460fa70c9e9cefcce52c7437f7acde61b9c3a2e84e9d49fd2dc33c7e9243053ceed5b247be03 WHIRLPOOL 1617687cd2144a09e2fe32b6e9bf49fcdb32f96c2979051f4c0826860eb59572c64c821d8de119f40e5546bc6132773a01702ba76c11be28a28c2926d9ed5c98
32
33 diff --git a/net-misc/dhcp/dhcp-4.3.6.ebuild b/net-misc/dhcp/dhcp-4.3.6.ebuild
34 new file mode 100644
35 index 00000000000..2404129b81e
36 --- /dev/null
37 +++ b/net-misc/dhcp/dhcp-4.3.6.ebuild
38 @@ -0,0 +1,262 @@
39 +# Copyright 1999-2017 Gentoo Foundation
40 +# Distributed under the terms of the GNU General Public License v2
41 +
42 +EAPI=6
43 +
44 +inherit systemd toolchain-funcs user
45 +
46 +MY_PV="${PV//_alpha/a}"
47 +MY_PV="${MY_PV//_beta/b}"
48 +MY_PV="${MY_PV//_rc/rc}"
49 +MY_PV="${MY_PV//_p/-P}"
50 +MY_P="${PN}-${MY_PV}"
51 +DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
52 +HOMEPAGE="http://www.isc.org/products/DHCP"
53 +SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
54 + ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
55 +
56 +LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
57 +SLOT="0"
58 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
59 +IUSE="+client ipv6 kernel_linux ldap libressl selinux +server ssl vim-syntax"
60 +
61 +DEPEND="
62 + client? (
63 + kernel_linux? (
64 + ipv6? ( sys-apps/iproute2 )
65 + sys-apps/net-tools
66 + )
67 + )
68 + ldap? (
69 + net-nds/openldap
70 + ssl? (
71 + !libressl? ( dev-libs/openssl:0 )
72 + libressl? ( dev-libs/libressl )
73 + )
74 + )"
75 +RDEPEND="${DEPEND}
76 + selinux? ( sec-policy/selinux-dhcp )
77 + vim-syntax? ( app-vim/dhcpd-syntax )"
78 +
79 +S="${WORKDIR}/${MY_P}"
80 +
81 +src_unpack() {
82 + unpack ${A}
83 + # handle local bind hell
84 + cd "${S}"/bind
85 + unpack ./bind.tar.gz
86 +}
87 +
88 +PATCHES=(
89 + # Gentoo patches - these will probably never be accepted upstream
90 + # Fix some permission issues
91 + "${FILESDIR}/${PN}-3.0-fix-perms.patch"
92 +
93 + # Enable dhclient to equery NTP servers
94 + "${FILESDIR}/${PN}-4.3.6-dhclient-ntp.patch"
95 + "${FILESDIR}/${PN}-4.3.6-dhclient-resolvconf.patch"
96 +
97 + # Enable dhclient to get extra configuration from stdin
98 + "${FILESDIR}/${PN}-4.2.2-dhclient-stdin-conf.patch"
99 + "${FILESDIR}/${PN}-4.3.6-nogateway.patch" #265531
100 + "${FILESDIR}/${PN}-4.3.6-quieter-ping.patch" #296921
101 + "${FILESDIR}/${PN}-4.2.4-always-accept-4.patch" #437108
102 + "${FILESDIR}/${PN}-4.3.6-iproute2-path.patch" #480636
103 + "${FILESDIR}/${PN}-4.2.5-bindtodevice-inet6.patch" #471142
104 + "${FILESDIR}/${PN}-4.3.3-ldap-ipv6-client-id.patch" #559832
105 +)
106 +
107 +src_prepare() {
108 + default
109 +
110 + # Brand the version with Gentoo
111 + sed -i \
112 + -e "/VERSION=/s:'$: Gentoo-${PR}':" \
113 + configure || die
114 +
115 + # Change the hook script locations of the scripts
116 + sed -i \
117 + -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
118 + -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
119 + client/scripts/* || die
120 +
121 + # No need for the linux script to force bash #158540
122 + sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
123 +
124 + # Quiet the freebsd logger a little
125 + sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
126 +
127 + # Remove these options from the sample config
128 + sed -i -r \
129 + -e "/(script|host-name|domain-name) /d" \
130 + client/dhclient.conf.example || die
131 +
132 + if use client && ! use server ; then
133 + sed -i -r \
134 + -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
135 + Makefile.in || die
136 + elif ! use client && use server ; then
137 + sed -i -r \
138 + -e '/^SUBDIRS/s:\<client\>::' \
139 + Makefile.in || die
140 + fi
141 +
142 + # Only install different man pages if we don't have en
143 + if [[ " ${LINGUAS} " != *" en "* ]]; then
144 + # Install Japanese man pages
145 + if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
146 + einfo "Installing Japanese documention"
147 + cp doc/ja_JP.eucJP/dhclient* client || die
148 + cp doc/ja_JP.eucJP/dhcp* common || die
149 + fi
150 + fi
151 + # Now remove the non-english docs so there are no errors later
152 + rm -r doc/ja_JP.eucJP || die
153 +
154 + # make the bind build work
155 + binddir="${S}/bind"
156 + cd "${binddir}" || die
157 + cat <<-EOF > bindvar.tmp
158 + binddir=${binddir}
159 + GMAKE=${MAKE:-gmake}
160 + EOF
161 + eapply -p2 "${FILESDIR}"/${PN}-4.3.4-bind-disable.patch
162 + cd bind-*/ || die
163 + eapply -p2 "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
164 +}
165 +
166 +src_configure() {
167 + # bind defaults to stupid `/usr/bin/ar`
168 + tc-export AR BUILD_CC
169 + export ac_cv_path_AR=${AR}
170 +
171 + # this is tested for by the bind build system, and can cause trouble
172 + # when cross-building; since dhcp itself doesn't make use of libcap,
173 + # simply disable it.
174 + export ac_cv_lib_cap_cap_set_proc=no
175 +
176 + # Use FHS sane paths ... some of these have configure options,
177 + # but not all, so just do it all here.
178 + local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
179 + cat <<-EOF >> includes/site.h
180 + #define _PATH_DHCPD_CONF "${e}/dhcpd.conf"
181 + #define _PATH_DHCLIENT_CONF "${e}/dhclient.conf"
182 + #define _PATH_DHCPD_DB "${l}/dhcpd.leases"
183 + #define _PATH_DHCPD6_DB "${l}/dhcpd6.leases"
184 + #define _PATH_DHCLIENT_DB "${l}/dhclient.leases"
185 + #define _PATH_DHCLIENT6_DB "${l}/dhclient6.leases"
186 + #define _PATH_DHCPD_PID "${r}/dhcpd.pid"
187 + #define _PATH_DHCPD6_PID "${r}/dhcpd6.pid"
188 + #define _PATH_DHCLIENT_PID "${r}/dhcpclient.pid"
189 + #define _PATH_DHCLIENT6_PID "${r}/dhcpclient6.pid"
190 + #define _PATH_DHCRELAY_PID "${r}/dhcrelay.pid"
191 + #define _PATH_DHCRELAY6_PID "${r}/dhcrelay6.pid"
192 + EOF
193 +
194 + local myeconfargs=(
195 + --enable-paranoia
196 + --enable-early-chroot
197 + --sysconfdir=${e}
198 + $(use_enable ipv6 dhcpv6)
199 + $(use_with ldap)
200 + $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
201 + )
202 + econf "${myeconfargs[@]}"
203 +
204 + # configure local bind cruft. symtable option requires
205 + # perl and we don't want to require that #383837.
206 + cd bind/bind-*/ || die
207 + eval econf \
208 + $(sed -n '/^bindconfig =/,/^$/{:a;N;$!ba;s,^[^-]*,,;s,\\\s*\n\s*--,--,g;s, @[[:upper:]]\+@,,g;P;D}' ../Makefile.in) \
209 + --disable-symtable \
210 + --without-make-clean
211 +}
212 +
213 +src_compile() {
214 + # build local bind cruft first
215 + emake -C bind/bind-*/lib/export install
216 + # then build standard dhcp code
217 + emake AR="$(tc-getAR)"
218 +}
219 +
220 +src_install() {
221 + default
222 +
223 + dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
224 + docinto html
225 + dodoc doc/References.html
226 +
227 + if [[ -e client/dhclient ]] ; then
228 + # move the client to /
229 + dodir /sbin
230 + mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
231 +
232 + exeinto /sbin
233 + if use kernel_linux ; then
234 + newexe "${S}"/client/scripts/linux dhclient-script
235 + else
236 + newexe "${S}"/client/scripts/freebsd dhclient-script
237 + fi
238 + fi
239 +
240 + if [[ -e server/dhcpd ]] ; then
241 + if use ldap ; then
242 + insinto /etc/openldap/schema
243 + doins contrib/ldap/dhcp.*
244 + dosbin contrib/ldap/dhcpd-conf-to-ldap
245 + fi
246 +
247 + newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
248 + newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
249 + newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
250 + newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
251 + newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
252 + newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
253 +
254 + systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
255 + systemd_dounit "${FILESDIR}"/dhcpd4.service
256 + systemd_dounit "${FILESDIR}"/dhcpd6.service
257 + systemd_dounit "${FILESDIR}"/dhcrelay4.service
258 + systemd_dounit "${FILESDIR}"/dhcrelay6.service
259 + systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
260 + systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
261 +
262 + sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
263 + fi
264 +
265 + # the default config files aren't terribly useful #384087
266 + local f
267 + for f in "${ED}"/etc/dhcp/*.conf.example ; do
268 + mv "${f}" "${f%.example}" || die
269 + done
270 + sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
271 +}
272 +
273 +pkg_preinst() {
274 + enewgroup dhcp
275 + enewuser dhcp -1 -1 /var/lib/dhcp dhcp
276 +
277 + # Keep the user files over the sample ones. The
278 + # hashing is to ignore the crappy defaults #384087.
279 + local f h
280 + for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
281 + h=${f#*:}
282 + f="/etc/dhcp/${f%:*}.conf"
283 + if [ -e "${EROOT}"${f} ] ; then
284 + case $(md5sum "${EROOT}"${f}) in
285 + ${h}*) ;;
286 + *) cp -p "${EROOT}"${f} "${ED}"${f};;
287 + esac
288 + fi
289 + done
290 +}
291 +
292 +pkg_postinst() {
293 + if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
294 + ewarn
295 + ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
296 + ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
297 + ewarn "and dhcp should be removed from the default runlevel"
298 + ewarn
299 + fi
300 +}
301
302 diff --git a/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch b/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
303 index 13debb20ed0..f4b3fd18e16 100644
304 --- a/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
305 +++ b/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
306 @@ -1,5 +1,5 @@
307 ---- server/dhcpd.c 2003-11-05 14:08:09.000000000 -0800
308 -+++ server/dhcpd.c 2003-11-05 14:15:32.000000000 -0800
309 +--- a/server/dhcpd.c
310 ++++ b/server/dhcpd.c
311 @@ -602,6 +602,12 @@
312 if (lftest)
313 exit (0);
314
315 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
316 index 518efec11c5..3a3b956e361 100644
317 --- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
318 +++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
319 @@ -1,5 +1,5 @@
320 ---- client/scripts/linux
321 -+++ client/scripts/linux
322 +--- a/client/scripts/linux
323 ++++ b/client/scripts/linux
324 @@ -118,9 +118,9 @@
325 if [ x$reason = xPREINIT ]; then
326 if [ x$alias_ip_address != x ]; then
327
328 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
329 new file mode 100644
330 index 00000000000..a504840dd5a
331 --- /dev/null
332 +++ b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch
333 @@ -0,0 +1,210 @@
334 +--- dhcp-4.3.6/client/clparse.c
335 ++++ dhcp-4.3.6/client/clparse.c
336 +@@ -31,7 +31,7 @@
337 +
338 + struct client_config top_level_config;
339 +
340 +-#define NUM_DEFAULT_REQUESTED_OPTS 9
341 ++#define NUM_DEFAULT_REQUESTED_OPTS 10
342 + /* There can be 2 extra requested options for DHCPv4-over-DHCPv6. */
343 + struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 2 + 1];
344 +
345 +@@ -107,15 +107,20 @@
346 + dhcp_universe.code_hash, &code, 0, MDL);
347 +
348 + /* 8 */
349 +- code = D6O_NAME_SERVERS;
350 ++ code = DHO_NTP_SERVERS;
351 + option_code_hash_lookup(&default_requested_options[7],
352 +- dhcpv6_universe.code_hash, &code, 0, MDL);
353 ++ dhcp_universe.code_hash, &code, 0, MDL);
354 +
355 + /* 9 */
356 +- code = D6O_DOMAIN_SEARCH;
357 ++ code = D6O_NAME_SERVERS;
358 + option_code_hash_lookup(&default_requested_options[8],
359 + dhcpv6_universe.code_hash, &code, 0, MDL);
360 +
361 ++ /* 10 */
362 ++ code = D6O_DOMAIN_SEARCH;
363 ++ option_code_hash_lookup(&default_requested_options[9],
364 ++ dhcpv6_universe.code_hash, &code, 0, MDL);
365 ++
366 + for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
367 + if (default_requested_options[code] == NULL)
368 + log_fatal("Unable to find option definition for "
369 +--- dhcp-4.3.6/client/scripts/bsdos
370 ++++ dhcp-4.3.6/client/scripts/bsdos
371 +@@ -36,6 +36,26 @@
372 +
373 + mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
374 + fi
375 ++ # If we're making confs, may as well make an ntp.conf too
376 ++ make_ntp_conf
377 ++}
378 ++
379 ++make_ntp_conf() {
380 ++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
381 ++ if [ x$new_ntp_servers != x ]; then
382 ++ conf="# Generated by dhclient for interface $interface\n"
383 ++ conf="${conf}restrict default noquery notrust nomodify\n"
384 ++ conf="${conf}restrict 127.0.0.1\n"
385 ++ for ntpserver in $new_ntp_servers; do
386 ++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
387 ++ conf="${conf}server $ntpserver\n"
388 ++ done
389 ++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
390 ++ conf="${conf}logfile /var/log/ntp.log\n"
391 ++ printf "${conf}" > /etc/ntp.conf
392 ++ chmod 644 /etc/ntp.conf
393 ++ fi
394 ++ fi
395 + }
396 +
397 + # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
398 +--- dhcp-4.3.6/client/scripts/freebsd
399 ++++ dhcp-4.3.6/client/scripts/freebsd
400 +@@ -80,6 +80,26 @@
401 + fi
402 + fi
403 + fi
404 ++ # If we're making confs, may as well make an ntp.conf too
405 ++ make_ntp_conf
406 ++}
407 ++
408 ++make_ntp_conf() {
409 ++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
410 ++ if [ "x$new_ntp_servers" != x ]; then
411 ++ conf="# Generated by dhclient for interface $interface\n"
412 ++ conf="${conf}restrict default noquery notrust nomodify\n"
413 ++ conf="${conf}restrict 127.0.0.1\n"
414 ++ for ntpserver in $new_ntp_servers; do
415 ++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
416 ++ conf="${conf}server $ntpserver\n"
417 ++ done
418 ++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
419 ++ conf="${conf}logfile /var/log/ntp.log\n"
420 ++ printf "${conf}" > /etc/ntp.conf
421 ++ chmod 644 /etc/ntp.conf
422 ++ fi
423 ++ fi
424 + }
425 +
426 + # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
427 +--- dhcp-4.3.6/client/scripts/linux
428 ++++ dhcp-4.3.6/client/scripts/linux
429 +@@ -106,6 +106,27 @@
430 + fi
431 + mv -f $new_resolv_conf /etc/resolv.conf
432 + fi
433 ++
434 ++ # If we're making confs, may as well make an ntp.conf too
435 ++ make_ntp_conf
436 ++}
437 ++
438 ++make_ntp_conf() {
439 ++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
440 ++ if [ "x$new_ntp_servers" != x ]; then
441 ++ conf="# Generated by dhclient for interface $interface\n"
442 ++ conf="${conf}restrict default noquery notrust nomodify\n"
443 ++ conf="${conf}restrict 127.0.0.1\n"
444 ++ for ntpserver in $new_ntp_servers; do
445 ++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
446 ++ conf="${conf}server $ntpserver\n"
447 ++ done
448 ++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
449 ++ conf="${conf}logfile /var/log/ntp.log\n"
450 ++ printf "${conf}" > /etc/ntp.conf
451 ++ chmod 644 /etc/ntp.conf
452 ++ fi
453 ++ fi
454 + }
455 +
456 + # set host name
457 +--- dhcp-4.3.6/client/scripts/netbsd
458 ++++ dhcp-4.3.6/client/scripts/netbsd
459 +@@ -36,6 +36,26 @@
460 +
461 + mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
462 + fi
463 ++ # If we're making confs, may as well make an ntp.conf too
464 ++ make_ntp_conf
465 ++}
466 ++
467 ++make_ntp_conf() {
468 ++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
469 ++ if [ "x$new_ntp_servers" != x ]; then
470 ++ conf="# Generated by dhclient for interface $interface\n"
471 ++ conf="${conf}restrict default noquery notrust nomodify\n"
472 ++ conf="${conf}restrict 127.0.0.1\n"
473 ++ for ntpserver in $new_ntp_servers; do
474 ++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
475 ++ conf="${conf}server $ntpserver\n"
476 ++ done
477 ++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
478 ++ conf="${conf}logfile /var/log/ntp.log\n"
479 ++ printf "${conf}" > /etc/ntp.conf
480 ++ chmod 644 /etc/ntp.conf
481 ++ fi
482 ++ fi
483 + }
484 +
485 + # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
486 +--- dhcp-4.3.6/client/scripts/openbsd
487 ++++ dhcp-4.3.6/client/scripts/openbsd
488 +@@ -36,6 +36,26 @@
489 +
490 + mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
491 + fi
492 ++ # If we're making confs, may as well make an ntp.conf too
493 ++ make_ntp_conf
494 ++}
495 ++
496 ++make_ntp_conf() {
497 ++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
498 ++ if [ "x$new_ntp_servers" != x ]; then
499 ++ conf="# Generated by dhclient for interface $interface\n"
500 ++ conf="${conf}restrict default noquery notrust nomodify\n"
501 ++ conf="${conf}restrict 127.0.0.1\n"
502 ++ for ntpserver in $new_ntp_servers; do
503 ++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
504 ++ conf="${conf}server $ntpserver\n"
505 ++ done
506 ++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
507 ++ conf="${conf}logfile /var/log/ntp.log\n"
508 ++ printf "${conf}" > /etc/ntp.conf
509 ++ chmod 644 /etc/ntp.conf
510 ++ fi
511 ++ fi
512 + }
513 +
514 + # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
515 +--- dhcp-4.3.6/client/scripts/solaris
516 ++++ dhcp-4.3.6/client/scripts/solaris
517 +@@ -17,6 +17,26 @@
518 +
519 + mv /etc/resolv.conf.dhclient /etc/resolv.conf
520 + fi
521 ++ # If we're making confs, may as well make an ntp.conf too
522 ++ make_ntp_conf
523 ++}
524 ++
525 ++make_ntp_conf() {
526 ++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
527 ++ if [ "x$new_ntp_servers" != x ]; then
528 ++ conf="# Generated by dhclient for interface $interface\n"
529 ++ conf="${conf}restrict default noquery notrust nomodify\n"
530 ++ conf="${conf}restrict 127.0.0.1\n"
531 ++ for ntpserver in $new_ntp_servers; do
532 ++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
533 ++ conf="${conf}server $ntpserver\n"
534 ++ done
535 ++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
536 ++ conf="${conf}logfile /var/log/ntp.log\n"
537 ++ printf "${conf}" > /etc/ntp.conf
538 ++ chmod 644 /etc/ntp.conf
539 ++ fi
540 ++ fi
541 + }
542 +
543 + # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
544
545 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
546 new file mode 100644
547 index 00000000000..ccfdbcf4a20
548 --- /dev/null
549 +++ b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch
550 @@ -0,0 +1,422 @@
551 +--- dhcp-4.3.6/client/scripts/bsdos
552 ++++ dhcp-4.3.6/client/scripts/bsdos
553 +@@ -1,27 +1,25 @@
554 + #!/bin/sh
555 +
556 + make_resolv_conf() {
557 ++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
558 ++ return 0
559 ++ fi
560 ++ local conf=
561 + if [ x"$new_domain_name_servers" != x ]; then
562 +- cat /dev/null > /etc/resolv.conf.dhclient
563 + if [ "x$new_domain_search" != x ]; then
564 +- echo search $new_domain_search >> /etc/resolv.conf.dhclient
565 ++ conf="${conf}search ${new_domain_search}\n"
566 + elif [ "x$new_domain_name" != x ]; then
567 + # Note that the DHCP 'Domain Name Option' is really just a domain
568 + # name, and that this practice of using the domain name option as
569 + # a search path is both nonstandard and deprecated.
570 +- echo search $new_domain_name >> /etc/resolv.conf.dhclient
571 ++ conf="${conf}search ${new_domain_name}\n"
572 + fi
573 + for nameserver in $new_domain_name_servers; do
574 +- echo nameserver $nameserver >> /etc/resolv.conf.dhclient
575 ++ conf="${conf}nameserver ${nameserver}\n"
576 + done
577 +-
578 +- mv /etc/resolv.conf.dhclient /etc/resolv.conf
579 + elif [ "x${new_dhcp6_name_servers}" != x ] ; then
580 +- cat /dev/null > /etc/resolv.conf.dhclient6
581 +- chmod 644 /etc/resolv.conf.dhclient6
582 +-
583 + if [ "x${new_dhcp6_domain_search}" != x ] ; then
584 +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
585 ++ conf="${conf}search ${new_dhcp6_domain_search}\n"
586 + fi
587 + for nameserver in ${new_dhcp6_name_servers} ; do
588 + # If the nameserver has a link-local address
589 +@@ -31,10 +29,18 @@
590 + FE80:*) zone_id="%$interface";;
591 + *) zone_id="";;
592 + esac
593 +- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
594 ++ conf="${conf}nameserver ${nameserver}$zone_id\n"
595 + done
596 ++ fi
597 +
598 +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
599 ++ if [ x"$conf" != x ]; then
600 ++ conf="# Generated by dhclient or interface $interface\n${conf}"
601 ++ if type resolvconf >/dev/null 2>&1; then
602 ++ printf "${conf}" | resolvconf -a $interface
603 ++ else
604 ++ printf "${conf}" > /etc/resolv.conf
605 ++ chmod 644 /etc/resolv.conf
606 ++ fi
607 + fi
608 + }
609 +
610 +--- dhcp-4.3.6/client/scripts/freebsd
611 ++++ dhcp-4.3.6/client/scripts/freebsd
612 +@@ -11,54 +11,23 @@
613 + fi
614 +
615 + make_resolv_conf() {
616 ++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
617 ++ return 0
618 ++ fi
619 ++ local conf=
620 + if [ x"$new_domain_name_servers" != x ]; then
621 +- ( cat /dev/null > /etc/resolv.conf.dhclient )
622 +- exit_status=$?
623 +- if [ $exit_status -ne 0 ]; then
624 +- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
625 +- else
626 +- if [ "x$new_domain_search" != x ]; then
627 +- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
628 +- exit_status=$?
629 +- elif [ "x$new_domain_name" != x ]; then
630 +- # Note that the DHCP 'Domain Name Option' is really just a domain
631 +- # name, and that this practice of using the domain name option as
632 +- # a search path is both nonstandard and deprecated.
633 +- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
634 +- exit_status=$?
635 +- fi
636 +- for nameserver in $new_domain_name_servers; do
637 +- if [ $exit_status -ne 0 ]; then
638 +- break
639 +- fi
640 +- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
641 +- exit_status=$?
642 +- done
643 +-
644 +- # If there were no errors, attempt to mv the new file into place.
645 +- if [ $exit_status -eq 0 ]; then
646 +- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
647 +- exit_status=$?
648 +- fi
649 +-
650 +- if [ $exit_status -ne 0 ]; then
651 +- $LOGGER "Error while writing new /etc/resolv.conf."
652 +- fi
653 ++ if [ "x$new_domain_search" != x ]; then
654 ++ conf="${conf}search ${new_domain_search}\n"
655 ++ elif [ "x$new_domain_name" != x ]; then
656 ++ # Note that the DHCP 'Domain Name Option' is really just a domain
657 ++ # name, and that this practice of using the domain name option as
658 ++ # a search path is both nonstandard and deprecated.
659 ++ conf="${conf}search ${new_domain_name}\n"
660 + fi
661 ++ for nameserver in $new_domain_name_servers; do
662 ++ conf="${conf}nameserver ${nameserver}\n"
663 ++ done
664 + elif [ "x${new_dhcp6_name_servers}" != x ] ; then
665 +- ( cat /dev/null > /etc/resolv.conf.dhclient6 )
666 +- exit_status=$?
667 +- if [ $exit_status -ne 0 ] ; then
668 +- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status"
669 +- else
670 +- if [ "x${new_dhcp6_domain_search}" != x ] ; then
671 +- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 )
672 +- exit_status=$?
673 +- fi
674 +- for nameserver in ${new_dhcp6_name_servers} ; do
675 +- if [ $exit_status -ne 0 ] ; then
676 +- break
677 +- fi
678 + # If the nameserver has a link-local address
679 + # add a <zone_id> (interface name) to it.
680 + case $nameserver in
681 +@@ -66,18 +35,21 @@
682 + FE80:*) zone_id="%$interface";;
683 + *) zone_id="";;
684 + esac
685 +- ( echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 )
686 +- exit_status=$?
687 +- done
688 +-
689 +- if [ $exit_status -eq 0 ] ; then
690 +- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf )
691 +- exit_status=$?
692 +- fi
693 ++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
694 ++ conf="${conf}search ${new_dhcp6_domain_search}\n"
695 ++ fi
696 ++ for nameserver in ${new_dhcp6_name_servers} ; do
697 ++ conf="${conf}nameserver ${nameserver}$zone_id\n"
698 ++ done
699 ++ fi
700 +
701 +- if [ $exit_status -ne 0 ] ; then
702 +- $LOGGER "Error while writing new /etc/resolv.conf."
703 +- fi
704 ++ if [ x"$conf" != x ]; then
705 ++ conf="# Generated by dhclient or interface $interface\n${conf}"
706 ++ if type resolvconf >/dev/null 2>&1; then
707 ++ printf "${conf}" | resolvconf -a $interface
708 ++ else
709 ++ printf "${conf}" > /etc/resolv.conf
710 ++ chmod 644 /etc/resolv.conf
711 + fi
712 + fi
713 + }
714 +--- dhcp-4.3.6/client/scripts/linux
715 ++++ dhcp-4.3.6/client/scripts/linux
716 +@@ -35,16 +35,16 @@
717 + # update /etc/resolv.conf based on received values
718 + # This updated version mostly follows Debian script by Andrew Pollock et al.
719 + make_resolv_conf() {
720 +- local new_resolv_conf
721 ++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
722 ++ return 0
723 ++ fi
724 ++ local conf
725 +
726 + # DHCPv4
727 + if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
728 + [ -n "$new_domain_name_servers" ]; then
729 +- new_resolv_conf=/etc/resolv.conf.dhclient-new
730 +- rm -f $new_resolv_conf
731 +-
732 + if [ -n "$new_domain_name" ]; then
733 +- echo domain ${new_domain_name%% *} >>$new_resolv_conf
734 ++ conf="${conf}domain ${new_domain_name%% *}\n"
735 + fi
736 +
737 + if [ -n "$new_domain_search" ]; then
738 +@@ -60,31 +60,23 @@
739 + new_domain_search="$new_domain_name $new_domain_search"
740 + fi
741 + fi
742 +- echo "search ${new_domain_search}" >> $new_resolv_conf
743 ++ conf="${conf}search ${new_domain_search}\n"
744 + elif [ -n "$new_domain_name" ]; then
745 +- echo "search ${new_domain_name}" >> $new_resolv_conf
746 ++ conf="${conf}search ${new_domain_name}\n"
747 + fi
748 +
749 + if [ -n "$new_domain_name_servers" ]; then
750 + for nameserver in $new_domain_name_servers; do
751 +- echo nameserver $nameserver >>$new_resolv_conf
752 ++ conf="${conf}nameserver $nameserver\n"
753 + done
754 + else # keep 'old' nameservers
755 +- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
756 ++ conf="${conf}$(sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf)\n"
757 + fi
758 +
759 +- if [ -f /etc/resolv.conf ]; then
760 +- chown --reference=/etc/resolv.conf $new_resolv_conf
761 +- chmod --reference=/etc/resolv.conf $new_resolv_conf
762 +- fi
763 +- mv -f $new_resolv_conf /etc/resolv.conf
764 + # DHCPv6
765 + elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then
766 +- new_resolv_conf=/etc/resolv.conf.dhclient-new
767 +- rm -f $new_resolv_conf
768 +-
769 + if [ -n "$new_dhcp6_domain_search" ]; then
770 +- echo "search ${new_dhcp6_domain_search}" >> $new_resolv_conf
771 ++ conf="${conf}search ${new_dhcp6_domain_search}\n"
772 + fi
773 +
774 + if [ -n "$new_dhcp6_name_servers" ]; then
775 +@@ -94,17 +86,21 @@
776 + [ "${nameserver##FE80::}" != "$nameserver" ]; then
777 + nameserver="${nameserver}%${interface}"
778 + fi
779 +- echo nameserver $nameserver >>$new_resolv_conf
780 ++ conf="${conf}nameserver $nameserver\n"
781 + done
782 + else # keep 'old' nameservers
783 +- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
784 ++ conf="${conf}$(sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf)\n"
785 + fi
786 ++ fi
787 +
788 +- if [ -f /etc/resolv.conf ]; then
789 +- chown --reference=/etc/resolv.conf $new_resolv_conf
790 +- chmod --reference=/etc/resolv.conf $new_resolv_conf
791 ++ if [ x"$conf" != x ]; then
792 ++ conf="# Generated by dhclient or interface $interface\n${conf}"
793 ++ if type resolvconf >/dev/null 2>&1; then
794 ++ printf "${conf}" | resolvconf -a $interface
795 ++ else
796 ++ printf "${conf}" > /etc/resolv.conf
797 ++ chmod 644 /etc/resolv.conf
798 + fi
799 +- mv -f $new_resolv_conf /etc/resolv.conf
800 + fi
801 + }
802 +
803 +--- dhcp-4.3.6/client/scripts/netbsd
804 ++++ dhcp-4.3.6/client/scripts/netbsd
805 +@@ -1,27 +1,25 @@
806 + #!/bin/sh
807 +
808 + make_resolv_conf() {
809 +- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
810 +- cat /dev/null > /etc/resolv.conf.dhclient
811 ++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
812 ++ return 0
813 ++ fi
814 ++ local conf=
815 ++ if [ x"$new_domain_name_servers" != x ]; then
816 + if [ "x$new_domain_search" != x ]; then
817 +- echo search $new_domain_search >> /etc/resolv.conf.dhclient
818 ++ conf="${conf}search ${new_domain_search}\n"
819 + elif [ "x$new_domain_name" != x ]; then
820 + # Note that the DHCP 'Domain Name Option' is really just a domain
821 + # name, and that this practice of using the domain name option as
822 + # a search path is both nonstandard and deprecated.
823 +- echo search $new_domain_name >> /etc/resolv.conf.dhclient
824 ++ conf="${conf}search ${new_domain_name}\n"
825 + fi
826 + for nameserver in $new_domain_name_servers; do
827 +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
828 ++ conf="${conf}nameserver ${nameserver}\n"
829 + done
830 +-
831 +- mv /etc/resolv.conf.dhclient /etc/resolv.conf
832 + elif [ "x${new_dhcp6_name_servers}" != x ] ; then
833 +- cat /dev/null > /etc/resolv.conf.dhclient6
834 +- chmod 644 /etc/resolv.conf.dhclient6
835 +-
836 + if [ "x${new_dhcp6_domain_search}" != x ] ; then
837 +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
838 ++ conf="${conf}search ${new_dhcp6_domain_search}\n"
839 + fi
840 + for nameserver in ${new_dhcp6_name_servers} ; do
841 + # If the nameserver has a link-local address
842 +@@ -31,10 +29,18 @@
843 + FE80:*) zone_id="%$interface";;
844 + *) zone_id="";;
845 + esac
846 +- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
847 ++ conf="${conf}nameserver ${nameserver}$zone_id\n"
848 + done
849 ++ fi
850 +
851 +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
852 ++ if [ x"$conf" != x ]; then
853 ++ conf="# Generated by dhclient or interface $interface\n${conf}"
854 ++ if type resolvconf >/dev/null 2>&1; then
855 ++ printf "${conf}" | resolvconf -a $interface
856 ++ else
857 ++ printf "${conf}" > /etc/resolv.conf
858 ++ chmod 644 /etc/resolv.conf
859 ++ fi
860 + fi
861 + }
862 +
863 +--- dhcp-4.3.6/client/scripts/openbsd
864 ++++ dhcp-4.3.6/client/scripts/openbsd
865 +@@ -1,27 +1,25 @@
866 + #!/bin/sh
867 +
868 + make_resolv_conf() {
869 ++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
870 ++ return 0
871 ++ fi
872 ++ local conf=
873 + if [ x"$new_domain_name_servers" != x ]; then
874 +- cat /dev/null > /etc/resolv.conf.dhclient
875 +- if [ x"$new_domain_search" != x ]; then
876 +- echo search $new_domain_search >> /etc/resolv.conf.dhclient
877 +- elif [ x"$new_domain_name" != x ]; then
878 ++ if [ "x$new_domain_search" != x ]; then
879 ++ conf="${conf}search ${new_domain_search}\n"
880 ++ elif [ "x$new_domain_name" != x ]; then
881 + # Note that the DHCP 'Domain Name Option' is really just a domain
882 + # name, and that this practice of using the domain name option as
883 + # a search path is both nonstandard and deprecated.
884 +- echo search $new_domain_name >> /etc/resolv.conf.dhclient
885 ++ conf="${conf}search ${new_domain_name}\n"
886 + fi
887 + for nameserver in $new_domain_name_servers; do
888 +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
889 ++ conf="${conf}nameserver ${nameserver}\n"
890 + done
891 +-
892 +- mv /etc/resolv.conf.dhclient /etc/resolv.conf
893 + elif [ "x${new_dhcp6_name_servers}" != x ] ; then
894 +- cat /dev/null > /etc/resolv.conf.dhclient6
895 +- chmod 644 /etc/resolv.conf.dhclient6
896 +-
897 + if [ "x${new_dhcp6_domain_search}" != x ] ; then
898 +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
899 ++ conf="${conf}search ${new_dhcp6_domain_search}\n"
900 + fi
901 + for nameserver in ${new_dhcp6_name_servers} ; do
902 + # If the nameserver has a link-local address
903 +@@ -31,10 +29,18 @@
904 + FE80:*) zone_id="%$interface";;
905 + *) zone_id="";;
906 + esac
907 +- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
908 ++ conf="${conf}nameserver ${nameserver}$zone_id\n"
909 + done
910 ++ fi
911 +
912 +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
913 ++ if [ x"$conf" != x ]; then
914 ++ conf="# Generated by dhclient or interface $interface\n${conf}"
915 ++ if type resolvconf >/dev/null 2>&1; then
916 ++ printf "${conf}" | resolvconf -a $interface
917 ++ else
918 ++ printf "${conf}" > /etc/resolv.conf
919 ++ chmod 644 /etc/resolv.conf
920 ++ fi
921 + fi
922 + }
923 +
924 +--- dhcp-4.3.6/client/scripts/solaris
925 ++++ dhcp-4.3.6/client/scripts/solaris
926 +@@ -1,21 +1,39 @@
927 + #!/bin/sh
928 +
929 + make_resolv_conf() {
930 ++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
931 ++ return 0
932 ++ fi
933 ++ local conf=
934 + if [ x"$new_domain_name_servers" != x ]; then
935 +- cat /dev/null > /etc/resolv.conf.dhclient
936 +- if [ x"$new_domain_search" != x ]; then
937 +- echo search $new_domain_search >> /etc/resolv.conf.dhclient
938 +- elif [ x"$new_domain_name" != x ]; then
939 ++ if [ "x$new_domain_search" != x ]; then
940 ++ conf="${conf}search ${new_domain_search}\n"
941 ++ elif [ "x$new_domain_name" != x ]; then
942 + # Note that the DHCP 'Domain Name Option' is really just a domain
943 + # name, and that this practice of using the domain name option as
944 + # a search path is both nonstandard and deprecated.
945 +- echo search $new_domain_name >> /etc/resolv.conf.dhclient
946 ++ conf="${conf}search ${new_domain_name}\n"
947 + fi
948 + for nameserver in $new_domain_name_servers; do
949 +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
950 ++ conf="${conf}nameserver ${nameserver}\n"
951 ++ done
952 ++ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
953 ++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
954 ++ conf="${conf}search ${new_dhcp6_domain_search}\n"
955 ++ fi
956 ++ for nameserver in ${new_dhcp6_name_servers} ; do
957 ++ conf="${conf}nameserver ${nameserver}\n"
958 + done
959 ++ fi
960 +
961 +- mv /etc/resolv.conf.dhclient /etc/resolv.conf
962 ++ if [ x"$conf" != x ]; then
963 ++ conf="# Generated by dhclient or interface $interface\n${conf}"
964 ++ if type resolvconf >/dev/null 2>&1; then
965 ++ printf "${conf}" | resolvconf -a $interface
966 ++ else
967 ++ printf "${conf}" > /etc/resolv.conf
968 ++ chmod 644 /etc/resolv.conf
969 ++ fi
970 + fi
971 + }
972 +
973
974 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
975 new file mode 100644
976 index 00000000000..18b04e620c1
977 --- /dev/null
978 +++ b/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch
979 @@ -0,0 +1,11 @@
980 +--- dhcp-4.3.6/client/scripts/linux
981 ++++ dhcp-4.3.6/client/scripts/linux
982 +@@ -30,7 +30,7 @@
983 + # 'ip' just looks too weird. Also, we now have unit-tests! Those unit-tests
984 + # overwirte this line to use a fake ip-echo tool. It's also convenient
985 + # if your system holds ip tool in a non-standard location.
986 +-ip=/sbin/ip
987 ++ip=ip
988 +
989 + # update /etc/resolv.conf based on received values
990 + # This updated version mostly follows Debian script by Andrew Pollock et al.
991
992 diff --git a/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch b/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch
993 new file mode 100644
994 index 00000000000..d299cc503f6
995 --- /dev/null
996 +++ b/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch
997 @@ -0,0 +1,66 @@
998 +--- dhcp-4.3.6/client/scripts/linux
999 ++++ dhcp-4.3.6/client/scripts/linux
1000 +@@ -242,20 +242,22 @@
1001 + if_metric=${if_metric:-1}
1002 + fi
1003 +
1004 +- for router in $new_routers; do
1005 +- if [ "$new_subnet_mask" = "255.255.255.255" ]; then
1006 +- # point-to-point connection => set explicit route
1007 +- ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
1008 +- fi
1009 +-
1010 +- # set default route
1011 +- ${ip} -4 route add default via ${router} dev ${interface} \
1012 +- ${if_metric:+metric $if_metric} >/dev/null 2>&1
1013 +-
1014 +- if [ -n "$if_metric" ]; then
1015 +- if_metric=$((if_metric+1))
1016 +- fi
1017 +- done
1018 ++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
1019 ++ for router in $new_routers; do
1020 ++ if [ "$new_subnet_mask" = "255.255.255.255" ]; then
1021 ++ # point-to-point connection => set explicit route
1022 ++ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
1023 ++ fi
1024 ++
1025 ++ # set default route
1026 ++ ${ip} -4 route add default via ${router} dev ${interface} \
1027 ++ ${if_metric:+metric $if_metric} >/dev/null 2>&1
1028 ++
1029 ++ if [ -n "$if_metric" ]; then
1030 ++ if_metric=$((if_metric+1))
1031 ++ fi
1032 ++ done
1033 ++ fi
1034 + fi
1035 + fi
1036 +
1037 +@@ -330,15 +332,17 @@
1038 + if_metric=${if_metric:-1}
1039 + fi
1040 +
1041 +- # set default route
1042 +- for router in $new_routers; do
1043 +- ${ip} -4 route add default via ${router} dev ${interface} \
1044 +- ${if_metric:+metric $if_metric} >/dev/null 2>&1
1045 +-
1046 +- if [ -n "$if_metric" ]; then
1047 +- if_metric=$((if_metric+1))
1048 +- fi
1049 +- done
1050 ++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
1051 ++ # set default route
1052 ++ for router in $new_routers; do
1053 ++ ${ip} -4 route add default via ${router} dev ${interface} \
1054 ++ ${if_metric:+metric $if_metric} >/dev/null 2>&1
1055 ++
1056 ++ if [ -n "$if_metric" ]; then
1057 ++ if_metric=$((if_metric+1))
1058 ++ fi
1059 ++ done
1060 ++ fi
1061 + fi
1062 +
1063 + # update /etc/resolv.conf
1064
1065 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
1066 new file mode 100644
1067 index 00000000000..3efb6459ebf
1068 --- /dev/null
1069 +++ b/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch
1070 @@ -0,0 +1,66 @@
1071 +--- dhcp-4.3.6/client/scripts/bsdos
1072 ++++ dhcp-4.3.6/client/scripts/bsdos
1073 +@@ -220,7 +220,7 @@
1074 + sleep 1
1075 + if [ "$new_routers" != "" ]; then
1076 + set $new_routers
1077 +- if ping -q -c 1 -w 1 $1; then
1078 ++ if ping -q -c 1 -w 1 $1 >/dev/null; then
1079 + if [ x$new_ip_address != x$alias_ip_address ] && \
1080 + [ x$alias_ip_address != x ]; then
1081 + ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
1082 +--- dhcp-4.3.6/client/scripts/freebsd
1083 ++++ dhcp-4.3.6/client/scripts/freebsd
1084 +@@ -287,7 +287,7 @@
1085 + if [ -n "$new_routers" ]; then
1086 + $LOGGER "New Routers: $new_routers"
1087 + set -- $new_routers
1088 +- if ping -q -c 1 $1; then
1089 ++ if ping -q -c 1 $1 >/dev/null; then
1090 + if [ x$new_ip_address != x$alias_ip_address ] && \
1091 + [ x$alias_ip_address != x ]; then
1092 + ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
1093 +--- dhcp-4.3.6/client/scripts/linux
1094 ++++ dhcp-4.3.6/client/scripts/linux
1095 +@@ -311,7 +311,7 @@
1096 + fi
1097 +
1098 + # if there is no router recorded in the lease or the 1st router answers pings
1099 +- if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}"; then
1100 ++ if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}" >/dev/null; then
1101 + # if we have $new_rfc3442_classless_static_routes then we have to
1102 + # ignore $new_routers entirely
1103 + if [ ! "$new_rfc3442_classless_static_routes" ]; then
1104 +--- dhcp-4.3.6/client/scripts/netbsd
1105 ++++ dhcp-4.3.6/client/scripts/netbsd
1106 +@@ -220,7 +220,7 @@
1107 + sleep 1
1108 + if [ "$new_routers" != "" ]; then
1109 + set $new_routers
1110 +- if ping -q -c 1 -w 1 $1; then
1111 ++ if ping -q -c 1 -w 1 $1 >/dev/null; then
1112 + if [ x$new_ip_address != x$alias_ip_address ] && \
1113 + [ x$alias_ip_address != x ]; then
1114 + ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
1115 +--- dhcp-4.3.6/client/scripts/openbsd
1116 ++++ dhcp-4.3.6/client/scripts/openbsd
1117 +@@ -214,7 +214,7 @@
1118 + sleep 1
1119 + if [ "$new_routers" != "" ]; then
1120 + set $new_routers
1121 +- if ping -q -c 1 -w 1 $1; then
1122 ++ if ping -q -c 1 -w 1 $1 >/dev/null; then
1123 + if [ x$new_ip_address != x$alias_ip_address ] && \
1124 + [ x$alias_ip_address != x ]; then
1125 + ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
1126 +--- dhcp-4.3.6/client/scripts/openwrt
1127 ++++ dhcp-4.3.6/client/scripts/openwrt
1128 +@@ -190,7 +190,7 @@
1129 + ifconfig $interface $new_ip_address $new_subnet_arg \
1130 + $new_broadcast_arg $mtu_arg
1131 + set $new_routers
1132 +- if ping -q -c 1 $1; then
1133 ++ if ping -q -c 1 $1 >/dev/null; then
1134 + if [ x$new_ip_address != x$alias_ip_address ] && \
1135 + [ x$alias_ip_address != x ]; then
1136 + ifconfig $interface:0 $alias_ip_address $alias_subnet_arg