1 |
commit: 8e7ee61b36033f35517f0a4287efb6973e02d979 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 30 10:21:10 2016 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 30 10:23:15 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e7ee61b |
7 |
|
8 |
net-misc/dhcp: Bump to version 4.3.4 |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
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.4.ebuild | 265 ++++++++++++++++++++++ |
15 |
net-misc/dhcp/files/dhcp-4.3.4-bind-disable.patch | 38 ++++ |
16 |
net-misc/dhcp/files/dhcp-4.3.4-dhclient-ntp.patch | 209 +++++++++++++++++ |
17 |
4 files changed, 513 insertions(+) |
18 |
|
19 |
diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest |
20 |
index 783e943..c6a6536 100644 |
21 |
--- a/net-misc/dhcp/Manifest |
22 |
+++ b/net-misc/dhcp/Manifest |
23 |
@@ -2,3 +2,4 @@ DIST dhcp-4.2.5-P1.tar.gz 8255960 SHA256 59b06c9f5d775e46999b422c45b9229402c462b |
24 |
DIST dhcp-4.3.1.tar.gz 8980806 SHA256 266cbca8a7a6bb8f9ccc5765da0d2b04099329314a54a4fc1022d510ad3e9af0 SHA512 84ca525fda825bf367a98754f1fb1b8eba5b095c92c25ddaec6e30b31008c7d5c43062ae43cecaa43731a8e78ae406a3123906fd402d2ba4b46b7adbae65aa6a WHIRLPOOL 3fd3720f6883b43856d2169264ee2adfb541b793604728c4e5cc3b647d4a88d6245fb6e53062de4118301cc15f0b4388363eba304bf3623dfb88c91bde94b2b6 |
25 |
DIST dhcp-4.3.3-P1.tar.gz 9204043 SHA256 c11e896dffa1bfbc49462965d3f6dec45534e34068603546d9a236f2aa669921 SHA512 7e14268b4acaa82c807af9d956f76f4327a9a75d36273a244fef74dbd54e7506e8b38ce6035e56f61ab09a19bfc0a40599f76c89dc342514f1048b5ac3b2a0eb WHIRLPOOL a0a6873e2f1625cfa208c328ed2d6ec507e239456d6eba24f5731a83ba16f5fbb36f0d6d99fd33fb9045cbf051116196a57c6c2ded2b36e93964475ad29d2b0e |
26 |
DIST dhcp-4.3.3.tar.gz 9205539 SHA256 553c4945b09b1c1b904c4780f34f72aaefa2fc8c6556715de0bc9d4e3d255ede SHA512 33671816e21456ffec57e2c9ab2d129377096b4e2e5b4ca8194dcd9495c6a9e18a2a5e79d4f05694f3dc841895aa0adb63afd7bd6fe4641eb5a80d3fd7e715d9 WHIRLPOOL 27e7f2fdd1f1f7b3309b444a67e21d139468317538345cc3599e6a47f20489fa5d07018eabe8e32c429f2f16f03c28b22b29bff2ab08972f541c63603bd3df9a |
27 |
+DIST dhcp-4.3.4.tar.gz 9302513 SHA256 f5115aee3dd3e6925de4ba47b80ab732ba48b481c8364b6ebade2d43698d607e SHA512 411c3f0e1effedb2a95f00539d13164530a56b50830008eb78906b3c8bf4070c331cf54a431770aed5d1b6ba214840446964210060674f746781cc97842ad706 WHIRLPOOL ea283592268c8efabd7fec430bd21c45306822b9275c91ee1e604d09e92f9eb3c50941ea11ecd9dcb230caec3b8e6ee94958e8eb6375e0ca0e7a64a8aaf63bce |
28 |
|
29 |
diff --git a/net-misc/dhcp/dhcp-4.3.4.ebuild b/net-misc/dhcp/dhcp-4.3.4.ebuild |
30 |
new file mode 100644 |
31 |
index 0000000..9b8f963 |
32 |
--- /dev/null |
33 |
+++ b/net-misc/dhcp/dhcp-4.3.4.ebuild |
34 |
@@ -0,0 +1,265 @@ |
35 |
+# Copyright 1999-2016 Gentoo Foundation |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+# $Id$ |
38 |
+ |
39 |
+EAPI=5 |
40 |
+ |
41 |
+inherit eutils systemd toolchain-funcs user |
42 |
+ |
43 |
+MY_PV="${PV//_alpha/a}" |
44 |
+MY_PV="${MY_PV//_beta/b}" |
45 |
+MY_PV="${MY_PV//_rc/rc}" |
46 |
+MY_PV="${MY_PV//_p/-P}" |
47 |
+MY_P="${PN}-${MY_PV}" |
48 |
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server" |
49 |
+HOMEPAGE="http://www.isc.org/products/DHCP" |
50 |
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz |
51 |
+ ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz" |
52 |
+ |
53 |
+LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script |
54 |
+SLOT="0" |
55 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
56 |
+IUSE="+client ipv6 kernel_linux ldap libressl selinux +server ssl vim-syntax" |
57 |
+ |
58 |
+DEPEND=" |
59 |
+ client? ( |
60 |
+ kernel_linux? ( |
61 |
+ ipv6? ( sys-apps/iproute2 ) |
62 |
+ sys-apps/net-tools |
63 |
+ ) |
64 |
+ ) |
65 |
+ ldap? ( |
66 |
+ net-nds/openldap |
67 |
+ ssl? ( |
68 |
+ !libressl? ( dev-libs/openssl:0 ) |
69 |
+ libressl? ( dev-libs/libressl ) |
70 |
+ ) |
71 |
+ )" |
72 |
+RDEPEND="${DEPEND} |
73 |
+ selinux? ( sec-policy/selinux-dhcp ) |
74 |
+ vim-syntax? ( app-vim/dhcpd-syntax )" |
75 |
+ |
76 |
+S="${WORKDIR}/${MY_P}" |
77 |
+ |
78 |
+src_unpack() { |
79 |
+ unpack ${A} |
80 |
+ # handle local bind hell |
81 |
+ cd "${S}"/bind |
82 |
+ unpack ./bind.tar.gz |
83 |
+} |
84 |
+ |
85 |
+PATCHES=( |
86 |
+ # Gentoo patches - these will probably never be accepted upstream |
87 |
+ # Fix some permission issues |
88 |
+ "${FILESDIR}/${PN}-3.0-fix-perms.patch" |
89 |
+ |
90 |
+ # Enable dhclient to equery NTP servers |
91 |
+ "${FILESDIR}/${PN}-4.3.4-dhclient-ntp.patch" |
92 |
+ "${FILESDIR}/${PN}-4.3.1-dhclient-resolvconf.patch" |
93 |
+ |
94 |
+ # Stop downing the interface on Linux as that breaks link daemons |
95 |
+ # such as wpa_supplicant and netplug |
96 |
+ "${FILESDIR}/${PN}-3.0.3-dhclient-no-down.patch" |
97 |
+ |
98 |
+ # Enable dhclient to get extra configuration from stdin |
99 |
+ "${FILESDIR}/${PN}-4.2.2-dhclient-stdin-conf.patch" |
100 |
+ "${FILESDIR}/${PN}-4.2.2-nogateway.patch" #265531 |
101 |
+ "${FILESDIR}/${PN}-4.2.4-quieter-ping.patch" #296921 |
102 |
+ "${FILESDIR}/${PN}-4.2.4-always-accept-4.patch" #437108 |
103 |
+ "${FILESDIR}/${PN}-4.2.5-iproute2-path.patch" #480636 |
104 |
+ "${FILESDIR}/${PN}-4.2.5-bindtodevice-inet6.patch" #471142 |
105 |
+ "${FILESDIR}/${PN}-4.3.3-ldap-ipv6-client-id.patch" #559832 |
106 |
+) |
107 |
+ |
108 |
+src_prepare() { |
109 |
+ epatch "${PATCHES[@]}" |
110 |
+ |
111 |
+ # Brand the version with Gentoo |
112 |
+ sed -i \ |
113 |
+ -e "/VERSION=/s:'$: Gentoo-${PR}':" \ |
114 |
+ configure || die |
115 |
+ |
116 |
+ # Change the hook script locations of the scripts |
117 |
+ sed -i \ |
118 |
+ -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \ |
119 |
+ -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \ |
120 |
+ client/scripts/* || die |
121 |
+ |
122 |
+ # No need for the linux script to force bash #158540 |
123 |
+ sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die |
124 |
+ |
125 |
+ # Quiet the freebsd logger a little |
126 |
+ sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die |
127 |
+ |
128 |
+ # Remove these options from the sample config |
129 |
+ sed -i -r \ |
130 |
+ -e "/(script|host-name|domain-name) /d" \ |
131 |
+ client/dhclient.conf.example || die |
132 |
+ |
133 |
+ if use client && ! use server ; then |
134 |
+ sed -i -r \ |
135 |
+ -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \ |
136 |
+ Makefile.in || die |
137 |
+ elif ! use client && use server ; then |
138 |
+ sed -i -r \ |
139 |
+ -e '/^SUBDIRS/s:\<client\>::' \ |
140 |
+ Makefile.in || die |
141 |
+ fi |
142 |
+ |
143 |
+ # Only install different man pages if we don't have en |
144 |
+ if [[ " ${LINGUAS} " != *" en "* ]]; then |
145 |
+ # Install Japanese man pages |
146 |
+ if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then |
147 |
+ einfo "Installing Japanese documention" |
148 |
+ cp doc/ja_JP.eucJP/dhclient* client |
149 |
+ cp doc/ja_JP.eucJP/dhcp* common |
150 |
+ fi |
151 |
+ fi |
152 |
+ # Now remove the non-english docs so there are no errors later |
153 |
+ rm -rf doc/ja_JP.eucJP |
154 |
+ |
155 |
+ # make the bind build work |
156 |
+ binddir=${S}/bind |
157 |
+ cd "${binddir}" || die |
158 |
+ cat <<-EOF > bindvar.tmp |
159 |
+ binddir=${binddir} |
160 |
+ GMAKE=${MAKE:-gmake} |
161 |
+ EOF |
162 |
+ epatch "${FILESDIR}"/${PN}-4.3.4-bind-disable.patch |
163 |
+ cd bind-*/ |
164 |
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717 |
165 |
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch |
166 |
+} |
167 |
+ |
168 |
+src_configure() { |
169 |
+ # bind defaults to stupid `/usr/bin/ar` |
170 |
+ tc-export AR BUILD_CC |
171 |
+ export ac_cv_path_AR=${AR} |
172 |
+ |
173 |
+ # this is tested for by the bind build system, and can cause trouble |
174 |
+ # when cross-building; since dhcp itself doesn't make use of libcap, |
175 |
+ # simply disable it. |
176 |
+ export ac_cv_lib_cap_cap_set_proc=no |
177 |
+ |
178 |
+ # Use FHS sane paths ... some of these have configure options, |
179 |
+ # but not all, so just do it all here. |
180 |
+ local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp" |
181 |
+ cat <<-EOF >> includes/site.h |
182 |
+ #define _PATH_DHCPD_CONF "${e}/dhcpd.conf" |
183 |
+ #define _PATH_DHCLIENT_CONF "${e}/dhclient.conf" |
184 |
+ #define _PATH_DHCPD_DB "${l}/dhcpd.leases" |
185 |
+ #define _PATH_DHCPD6_DB "${l}/dhcpd6.leases" |
186 |
+ #define _PATH_DHCLIENT_DB "${l}/dhclient.leases" |
187 |
+ #define _PATH_DHCLIENT6_DB "${l}/dhclient6.leases" |
188 |
+ #define _PATH_DHCPD_PID "${r}/dhcpd.pid" |
189 |
+ #define _PATH_DHCPD6_PID "${r}/dhcpd6.pid" |
190 |
+ #define _PATH_DHCLIENT_PID "${r}/dhcpclient.pid" |
191 |
+ #define _PATH_DHCLIENT6_PID "${r}/dhcpclient6.pid" |
192 |
+ #define _PATH_DHCRELAY_PID "${r}/dhcrelay.pid" |
193 |
+ #define _PATH_DHCRELAY6_PID "${r}/dhcrelay6.pid" |
194 |
+ EOF |
195 |
+ |
196 |
+ econf \ |
197 |
+ --enable-paranoia \ |
198 |
+ --enable-early-chroot \ |
199 |
+ --sysconfdir=${e} \ |
200 |
+ $(use_enable ipv6 dhcpv6) \ |
201 |
+ $(use_with ldap) \ |
202 |
+ $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto) |
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 |
+ dohtml doc/References.html |
225 |
+ |
226 |
+ if [[ -e client/dhclient ]] ; then |
227 |
+ # move the client to / |
228 |
+ dodir /sbin |
229 |
+ mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die |
230 |
+ |
231 |
+ exeinto /sbin |
232 |
+ if use kernel_linux ; then |
233 |
+ newexe "${S}"/client/scripts/linux dhclient-script |
234 |
+ else |
235 |
+ newexe "${S}"/client/scripts/freebsd dhclient-script |
236 |
+ fi |
237 |
+ fi |
238 |
+ |
239 |
+ if [[ -e server/dhcpd ]] ; then |
240 |
+ if use ldap ; then |
241 |
+ insinto /etc/openldap/schema |
242 |
+ doins contrib/ldap/dhcp.* |
243 |
+ dosbin contrib/ldap/dhcpd-conf-to-ldap |
244 |
+ fi |
245 |
+ |
246 |
+ newinitd "${FILESDIR}"/dhcpd.init5 dhcpd |
247 |
+ newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd |
248 |
+ newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay |
249 |
+ newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay |
250 |
+ newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6 |
251 |
+ newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6 |
252 |
+ |
253 |
+ systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf |
254 |
+ systemd_dounit "${FILESDIR}"/dhcpd4.service |
255 |
+ systemd_dounit "${FILESDIR}"/dhcpd6.service |
256 |
+ systemd_dounit "${FILESDIR}"/dhcrelay4.service |
257 |
+ systemd_dounit "${FILESDIR}"/dhcrelay6.service |
258 |
+ systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf |
259 |
+ systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf |
260 |
+ |
261 |
+ sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560 |
262 |
+ fi |
263 |
+ |
264 |
+ # the default config files aren't terribly useful #384087 |
265 |
+ local f |
266 |
+ for f in "${ED}"/etc/dhcp/*.conf.example ; do |
267 |
+ mv "${f}" "${f%.example}" || die |
268 |
+ done |
269 |
+ sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die |
270 |
+} |
271 |
+ |
272 |
+pkg_preinst() { |
273 |
+ enewgroup dhcp |
274 |
+ enewuser dhcp -1 -1 /var/lib/dhcp dhcp |
275 |
+ |
276 |
+ # Keep the user files over the sample ones. The |
277 |
+ # hashing is to ignore the crappy defaults #384087. |
278 |
+ local f h |
279 |
+ for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do |
280 |
+ h=${f#*:} |
281 |
+ f="/etc/dhcp/${f%:*}.conf" |
282 |
+ if [ -e "${EROOT}"${f} ] ; then |
283 |
+ case $(md5sum "${EROOT}"${f}) in |
284 |
+ ${h}*) ;; |
285 |
+ *) cp -p "${EROOT}"${f} "${ED}"${f};; |
286 |
+ esac |
287 |
+ fi |
288 |
+ done |
289 |
+} |
290 |
+ |
291 |
+pkg_postinst() { |
292 |
+ if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then |
293 |
+ ewarn |
294 |
+ ewarn "WARNING: The dhcp init script has been renamed to dhcpd" |
295 |
+ ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and" |
296 |
+ ewarn "and dhcp should be removed from the default runlevel" |
297 |
+ ewarn |
298 |
+ fi |
299 |
+} |
300 |
|
301 |
diff --git a/net-misc/dhcp/files/dhcp-4.3.4-bind-disable.patch b/net-misc/dhcp/files/dhcp-4.3.4-bind-disable.patch |
302 |
new file mode 100644 |
303 |
index 0000000..be0c032 |
304 |
--- /dev/null |
305 |
+++ b/net-misc/dhcp/files/dhcp-4.3.4-bind-disable.patch |
306 |
@@ -0,0 +1,38 @@ |
307 |
+--- dhcp-4.3.4/bind/Makefile.in |
308 |
++++ dhcp-4.3.4/bind/Makefile.in |
309 |
+@@ -40,6 +40,7 @@ |
310 |
+ @BIND_ATF_TRUE@all: bind1 atf bind2 |
311 |
+ |
312 |
+ bind1: |
313 |
++disable: |
314 |
+ # Extract the source from the tarball, if it hasn't been already. |
315 |
+ @if test -d ${bindsrcdir} ; then \ |
316 |
+ echo ${bindsrcdir} already unpacked... ; \ |
317 |
+@@ -68,6 +69,7 @@ |
318 |
+ fi |
319 |
+ |
320 |
+ atf: |
321 |
++disable: |
322 |
+ # Build and copy the ATF support if not yet installed. |
323 |
+ @if test -d ./atf ; then \ |
324 |
+ echo ATF support already installed ; \ |
325 |
+@@ -82,6 +84,7 @@ |
326 |
+ @CROSS_COMPILING_TRUE@bind2: bind2-hostgen |
327 |
+ |
328 |
+ bind2-noguest: |
329 |
++disable: |
330 |
+ # Build and install the export libraries |
331 |
+ # No need to do anything if we already have something installed. |
332 |
+ @if test -d ${binddir}/lib ; then \ |
333 |
+@@ -98,6 +101,7 @@ |
334 |
+ fi |
335 |
+ |
336 |
+ bind2-hostgen: |
337 |
++disable: |
338 |
+ # Build and install the export libraries |
339 |
+ # No need to do anything if we already have something installed. |
340 |
+ @if test -d ${binddir}/lib ; then \ |
341 |
+--- dhcp-4.3.4/bind/test |
342 |
++++ dhcp-4.3.4/bind/test |
343 |
+@@ -0,0 +1 @@ |
344 |
++--disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --with-gssapi=no --enable-threads=no @BINDCONFIG@ --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib |
345 |
|
346 |
diff --git a/net-misc/dhcp/files/dhcp-4.3.4-dhclient-ntp.patch b/net-misc/dhcp/files/dhcp-4.3.4-dhclient-ntp.patch |
347 |
new file mode 100644 |
348 |
index 0000000..2076317 |
349 |
--- /dev/null |
350 |
+++ b/net-misc/dhcp/files/dhcp-4.3.4-dhclient-ntp.patch |
351 |
@@ -0,0 +1,209 @@ |
352 |
+--- dhcp-4.3.4/client/clparse.c |
353 |
++++ dhcp-4.3.4/client/clparse.c |
354 |
+@@ -31,7 +31,7 @@ |
355 |
+ |
356 |
+ struct client_config top_level_config; |
357 |
+ |
358 |
+-#define NUM_DEFAULT_REQUESTED_OPTS 9 |
359 |
++#define NUM_DEFAULT_REQUESTED_OPTS 10 |
360 |
+ /* There can be 2 extra requested options for DHCPv4-over-DHCPv6. */ |
361 |
+ struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 2 + 1]; |
362 |
+ |
363 |
+@@ -107,15 +107,20 @@ |
364 |
+ dhcp_universe.code_hash, &code, 0, MDL); |
365 |
+ |
366 |
+ /* 8 */ |
367 |
+- code = D6O_NAME_SERVERS; |
368 |
++ code = DHO_NTP_SERVERS; |
369 |
+ option_code_hash_lookup(&default_requested_options[7], |
370 |
+- dhcpv6_universe.code_hash, &code, 0, MDL); |
371 |
++ dhcp_universe.code_hash, &code, 0, MDL); |
372 |
+ |
373 |
+ /* 9 */ |
374 |
+- code = D6O_DOMAIN_SEARCH; |
375 |
++ code = D6O_NAME_SERVERS; |
376 |
+ option_code_hash_lookup(&default_requested_options[8], |
377 |
+ dhcpv6_universe.code_hash, &code, 0, MDL); |
378 |
+ |
379 |
++ /* 10 */ |
380 |
++ code = D6O_DOMAIN_SEARCH; |
381 |
++ option_code_hash_lookup(&default_requested_options[9], |
382 |
++ dhcpv6_universe.code_hash, &code, 0, MDL); |
383 |
++ |
384 |
+ for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) { |
385 |
+ if (default_requested_options[code] == NULL) |
386 |
+ log_fatal("Unable to find option definition for " |
387 |
+--- dhcp-4.3.4/client/scripts/bsdos |
388 |
++++ dhcp-4.3.4/client/scripts/bsdos |
389 |
+@@ -36,6 +36,26 @@ |
390 |
+ |
391 |
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf |
392 |
+ fi |
393 |
++ # If we're making confs, may as well make an ntp.conf too |
394 |
++ make_ntp_conf |
395 |
++} |
396 |
++ |
397 |
++make_ntp_conf() { |
398 |
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then |
399 |
++ if [ x$new_ntp_servers != x ]; then |
400 |
++ conf="# Generated by dhclient for interface $interface\n" |
401 |
++ conf="${conf}restrict default noquery notrust nomodify\n" |
402 |
++ conf="${conf}restrict 127.0.0.1\n" |
403 |
++ for ntpserver in $new_ntp_servers; do |
404 |
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n" |
405 |
++ conf="${conf}server $ntpserver\n" |
406 |
++ done |
407 |
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n" |
408 |
++ conf="${conf}logfile /var/log/ntp.log\n" |
409 |
++ printf "${conf}" > /etc/ntp.conf |
410 |
++ chmod 644 /etc/ntp.conf |
411 |
++ fi |
412 |
++ fi |
413 |
+ } |
414 |
+ |
415 |
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any. |
416 |
+--- dhcp-4.3.4/client/scripts/freebsd |
417 |
++++ dhcp-4.3.4/client/scripts/freebsd |
418 |
+@@ -80,6 +80,26 @@ |
419 |
+ fi |
420 |
+ fi |
421 |
+ fi |
422 |
++ # If we're making confs, may as well make an ntp.conf too |
423 |
++ make_ntp_conf |
424 |
++} |
425 |
++ |
426 |
++make_ntp_conf() { |
427 |
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then |
428 |
++ if [ "x$new_ntp_servers" != x ]; then |
429 |
++ conf="# Generated by dhclient for interface $interface\n" |
430 |
++ conf="${conf}restrict default noquery notrust nomodify\n" |
431 |
++ conf="${conf}restrict 127.0.0.1\n" |
432 |
++ for ntpserver in $new_ntp_servers; do |
433 |
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n" |
434 |
++ conf="${conf}server $ntpserver\n" |
435 |
++ done |
436 |
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n" |
437 |
++ conf="${conf}logfile /var/log/ntp.log\n" |
438 |
++ printf "${conf}" > /etc/ntp.conf |
439 |
++ chmod 644 /etc/ntp.conf |
440 |
++ fi |
441 |
++ fi |
442 |
+ } |
443 |
+ |
444 |
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any. |
445 |
+--- dhcp-4.3.4/client/scripts/linux |
446 |
++++ dhcp-4.3.4/client/scripts/linux |
447 |
+@@ -65,6 +65,26 @@ |
448 |
+ |
449 |
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf |
450 |
+ fi |
451 |
++ # If we're making confs, may as well make an ntp.conf too |
452 |
++ make_ntp_conf |
453 |
++} |
454 |
++ |
455 |
++make_ntp_conf() { |
456 |
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then |
457 |
++ if [ "x$new_ntp_servers" != x ]; then |
458 |
++ conf="# Generated by dhclient for interface $interface\n" |
459 |
++ conf="${conf}restrict default noquery notrust nomodify\n" |
460 |
++ conf="${conf}restrict 127.0.0.1\n" |
461 |
++ for ntpserver in $new_ntp_servers; do |
462 |
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n" |
463 |
++ conf="${conf}server $ntpserver\n" |
464 |
++ done |
465 |
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n" |
466 |
++ conf="${conf}logfile /var/log/ntp.log\n" |
467 |
++ printf "${conf}" > /etc/ntp.conf |
468 |
++ chmod 644 /etc/ntp.conf |
469 |
++ fi |
470 |
++ fi |
471 |
+ } |
472 |
+ |
473 |
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any. |
474 |
+--- dhcp-4.3.4/client/scripts/netbsd |
475 |
++++ dhcp-4.3.4/client/scripts/netbsd |
476 |
+@@ -36,6 +36,26 @@ |
477 |
+ |
478 |
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf |
479 |
+ fi |
480 |
++ # If we're making confs, may as well make an ntp.conf too |
481 |
++ make_ntp_conf |
482 |
++} |
483 |
++ |
484 |
++make_ntp_conf() { |
485 |
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then |
486 |
++ if [ "x$new_ntp_servers" != x ]; then |
487 |
++ conf="# Generated by dhclient for interface $interface\n" |
488 |
++ conf="${conf}restrict default noquery notrust nomodify\n" |
489 |
++ conf="${conf}restrict 127.0.0.1\n" |
490 |
++ for ntpserver in $new_ntp_servers; do |
491 |
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n" |
492 |
++ conf="${conf}server $ntpserver\n" |
493 |
++ done |
494 |
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n" |
495 |
++ conf="${conf}logfile /var/log/ntp.log\n" |
496 |
++ printf "${conf}" > /etc/ntp.conf |
497 |
++ chmod 644 /etc/ntp.conf |
498 |
++ fi |
499 |
++ fi |
500 |
+ } |
501 |
+ |
502 |
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any. |
503 |
+--- dhcp-4.3.4/client/scripts/openbsd |
504 |
++++ dhcp-4.3.4/client/scripts/openbsd |
505 |
+@@ -36,6 +36,26 @@ |
506 |
+ |
507 |
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf |
508 |
+ fi |
509 |
++ # If we're making confs, may as well make an ntp.conf too |
510 |
++ make_ntp_conf |
511 |
++} |
512 |
++ |
513 |
++make_ntp_conf() { |
514 |
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then |
515 |
++ if [ "x$new_ntp_servers" != x ]; then |
516 |
++ conf="# Generated by dhclient for interface $interface\n" |
517 |
++ conf="${conf}restrict default noquery notrust nomodify\n" |
518 |
++ conf="${conf}restrict 127.0.0.1\n" |
519 |
++ for ntpserver in $new_ntp_servers; do |
520 |
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n" |
521 |
++ conf="${conf}server $ntpserver\n" |
522 |
++ done |
523 |
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n" |
524 |
++ conf="${conf}logfile /var/log/ntp.log\n" |
525 |
++ printf "${conf}" > /etc/ntp.conf |
526 |
++ chmod 644 /etc/ntp.conf |
527 |
++ fi |
528 |
++ fi |
529 |
+ } |
530 |
+ |
531 |
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any. |
532 |
+--- dhcp-4.3.4/client/scripts/solaris |
533 |
++++ dhcp-4.3.4/client/scripts/solaris |
534 |
+@@ -17,6 +17,26 @@ |
535 |
+ |
536 |
+ mv /etc/resolv.conf.dhclient /etc/resolv.conf |
537 |
+ fi |
538 |
++ # If we're making confs, may as well make an ntp.conf too |
539 |
++ make_ntp_conf |
540 |
++} |
541 |
++ |
542 |
++make_ntp_conf() { |
543 |
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then |
544 |
++ if [ "x$new_ntp_servers" != x ]; then |
545 |
++ conf="# Generated by dhclient for interface $interface\n" |
546 |
++ conf="${conf}restrict default noquery notrust nomodify\n" |
547 |
++ conf="${conf}restrict 127.0.0.1\n" |
548 |
++ for ntpserver in $new_ntp_servers; do |
549 |
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n" |
550 |
++ conf="${conf}server $ntpserver\n" |
551 |
++ done |
552 |
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n" |
553 |
++ conf="${conf}logfile /var/log/ntp.log\n" |
554 |
++ printf "${conf}" > /etc/ntp.conf |
555 |
++ chmod 644 /etc/ntp.conf |
556 |
++ fi |
557 |
++ fi |
558 |
+ } |
559 |
+ |
560 |
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any. |