public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2016-01-13  9:45 Lars Wendler
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Wendler @ 2016-01-13  9:45 UTC (permalink / raw
  To: gentoo-commits

commit:     2db723bf3f4e187785d20741fa5e745242cec04f
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 13 09:44:53 2016 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Jan 13 09:45:14 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2db723bf

net-misc/dhcp: Removed old.

Package-Manager: portage-2.2.26
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 net-misc/dhcp/Manifest                             |   1 -
 net-misc/dhcp/dhcp-4.3.2.ebuild                    | 254 --------------------
 net-misc/dhcp/dhcp-4.3.3.ebuild                    | 255 ---------------------
 net-misc/dhcp/files/dhcp-3.0-paranoia.patch        | 207 -----------------
 .../dhcp/files/dhcp-3.1.3-dhclient-no-down.patch   |  77 -------
 5 files changed, 794 deletions(-)

diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
index 7babe8f..783e943 100644
--- a/net-misc/dhcp/Manifest
+++ b/net-misc/dhcp/Manifest
@@ -1,5 +1,4 @@
 DIST dhcp-4.2.5-P1.tar.gz 8255960 SHA256 59b06c9f5d775e46999b422c45b9229402c462b114ce1685617bfb2b8b028250 SHA512 02a811b6e88ce013f7ecff6abf81d4b2aff82fff584521ae03fc3242b6036d0d0ad3afc6283fe8b97d18b8fffd4b6d2253386897ae2297c165240017f5f219ec WHIRLPOOL b8cf91c69ae0e1b234089ce3fae4b9daf5bde7f415d8cbc274ab4d006c8aa25f55807c70ba4c6771e0c9803ec5a99f8cc2088e561cac7d16479f5f022ee5459f
 DIST dhcp-4.3.1.tar.gz 8980806 SHA256 266cbca8a7a6bb8f9ccc5765da0d2b04099329314a54a4fc1022d510ad3e9af0 SHA512 84ca525fda825bf367a98754f1fb1b8eba5b095c92c25ddaec6e30b31008c7d5c43062ae43cecaa43731a8e78ae406a3123906fd402d2ba4b46b7adbae65aa6a WHIRLPOOL 3fd3720f6883b43856d2169264ee2adfb541b793604728c4e5cc3b647d4a88d6245fb6e53062de4118301cc15f0b4388363eba304bf3623dfb88c91bde94b2b6
-DIST dhcp-4.3.2.tar.gz 9230340 SHA256 6246c9b358759f6cdcc45104caaf76e732a211dbbbbf64a21f499c8db1298165 SHA512 b91a0a90736c6e8bd66a74af8c67949c81db3148eba23ee647f0987bbd98543f0dfd1605c94e152b28a606bbbecd94cd8a8112db5f5fe4c3d041101bda1b95da WHIRLPOOL a201cea52e96517ff1dae2b6c05b05da11feb4c2eed6dca539ea5ab3185711377cd7f7ed9ecc5e5f2bc30bc84d73a85d4140154c43b4f0f27a7e0a4a51f56787
 DIST dhcp-4.3.3-P1.tar.gz 9204043 SHA256 c11e896dffa1bfbc49462965d3f6dec45534e34068603546d9a236f2aa669921 SHA512 7e14268b4acaa82c807af9d956f76f4327a9a75d36273a244fef74dbd54e7506e8b38ce6035e56f61ab09a19bfc0a40599f76c89dc342514f1048b5ac3b2a0eb WHIRLPOOL a0a6873e2f1625cfa208c328ed2d6ec507e239456d6eba24f5731a83ba16f5fbb36f0d6d99fd33fb9045cbf051116196a57c6c2ded2b36e93964475ad29d2b0e
 DIST dhcp-4.3.3.tar.gz 9205539 SHA256 553c4945b09b1c1b904c4780f34f72aaefa2fc8c6556715de0bc9d4e3d255ede SHA512 33671816e21456ffec57e2c9ab2d129377096b4e2e5b4ca8194dcd9495c6a9e18a2a5e79d4f05694f3dc841895aa0adb63afd7bd6fe4641eb5a80d3fd7e715d9 WHIRLPOOL 27e7f2fdd1f1f7b3309b444a67e21d139468317538345cc3599e6a47f20489fa5d07018eabe8e32c429f2f16f03c28b22b29bff2ab08972f541c63603bd3df9a

diff --git a/net-misc/dhcp/dhcp-4.3.2.ebuild b/net-misc/dhcp/dhcp-4.3.2.ebuild
deleted file mode 100644
index 447f44c..0000000
--- a/net-misc/dhcp/dhcp-4.3.2.ebuild
+++ /dev/null
@@ -1,254 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-
-inherit eutils systemd toolchain-funcs user
-
-MY_PV="${PV//_alpha/a}"
-MY_PV="${MY_PV//_beta/b}"
-MY_PV="${MY_PV//_rc/rc}"
-MY_PV="${MY_PV//_p/-P}"
-MY_P="${PN}-${MY_PV}"
-DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
-HOMEPAGE="http://www.isc.org/products/DHCP"
-SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
-	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
-
-LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
-IUSE="+client ipv6 kernel_linux ldap selinux +server ssl vim-syntax"
-
-DEPEND="
-	client? (
-		kernel_linux? (
-			ipv6? ( sys-apps/iproute2 )
-			sys-apps/net-tools
-		)
-	)
-	ldap? (
-		net-nds/openldap
-		ssl? ( dev-libs/openssl )
-	)"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-dhcp )
-	vim-syntax? ( app-vim/dhcpd-syntax )"
-
-S="${WORKDIR}/${MY_P}"
-
-src_unpack() {
-	unpack ${A}
-	# handle local bind hell
-	cd "${S}"/bind
-	unpack ./bind.tar.gz
-}
-
-src_prepare() {
-	# Gentoo patches - these will probably never be accepted upstream
-	# Fix some permission issues
-	epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch
-	# Enable dhclient to equery NTP servers
-	epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch
-	epatch "${FILESDIR}"/${PN}-4.3.1-dhclient-resolvconf.patch
-	# Stop downing the interface on Linux as that breaks link daemons
-	# such as wpa_supplicant and netplug
-	epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch
-	# Enable dhclient to get extra configuration from stdin
-	epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-stdin-conf.patch
-	epatch "${FILESDIR}"/${PN}-4.2.2-nogateway.patch #265531
-	epatch "${FILESDIR}"/${PN}-4.2.4-quieter-ping.patch #296921
-	epatch "${FILESDIR}"/${PN}-4.2.4-always-accept-4.patch #437108
-	epatch "${FILESDIR}"/${PN}-4.2.5-iproute2-path.patch #480636
-	epatch "${FILESDIR}"/${PN}-4.2.5-bindtodevice-inet6.patch #471142
-
-	# Brand the version with Gentoo
-	sed -i \
-		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
-		configure || die
-
-	# Change the hook script locations of the scripts
-	sed -i \
-		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
-		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
-		client/scripts/* || die
-
-	# No need for the linux script to force bash #158540
-	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
-
-	# Quiet the freebsd logger a little
-	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
-
-	# Remove these options from the sample config
-	sed -i -r \
-		-e "/(script|host-name|domain-name) /d" \
-		client/dhclient.conf.example || die
-
-	if use client && ! use server ; then
-		sed -i -r \
-			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
-			Makefile.in || die
-	elif ! use client && use server ; then
-		sed -i -r \
-			-e '/^SUBDIRS/s:\<client\>::' \
-			Makefile.in || die
-	fi
-
-	# Only install different man pages if we don't have en
-	if [[ " ${LINGUAS} " != *" en "* ]]; then
-		# Install Japanese man pages
-		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
-			einfo "Installing Japanese documention"
-			cp doc/ja_JP.eucJP/dhclient* client
-			cp doc/ja_JP.eucJP/dhcp* common
-		fi
-	fi
-	# Now remove the non-english docs so there are no errors later
-	rm -rf doc/ja_JP.eucJP
-
-	# make the bind build work
-	binddir=${S}/bind
-	cd "${binddir}" || die
-	cat <<-EOF > bindvar.tmp
-	binddir=${binddir}
-	GMAKE=${MAKE:-gmake}
-	EOF
-	epatch "${FILESDIR}"/${PN}-4.2.2-bind-disable.patch
-	cd bind-*/
-	epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
-	epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
-}
-
-src_configure() {
-	# bind defaults to stupid `/usr/bin/ar`
-	tc-export AR BUILD_CC
-	export ac_cv_path_AR=${AR}
-
-	# this is tested for by the bind build system, and can cause trouble
-	# when cross-building; since dhcp itself doesn't make use of libcap,
-	# simply disable it.
-	export ac_cv_lib_cap_cap_set_proc=no
-
-	# Use FHS sane paths ... some of these have configure options,
-	# but not all, so just do it all here.
-	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
-	cat <<-EOF >> includes/site.h
-	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
-	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
-	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
-	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
-	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
-	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
-	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
-	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
-	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
-	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
-	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
-	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
-	EOF
-
-	econf \
-		--enable-paranoia \
-		--enable-early-chroot \
-		--sysconfdir=${e} \
-		$(use_enable ipv6 dhcpv6) \
-		$(use_with ldap) \
-		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
-
-	# configure local bind cruft.  symtable option requires
-	# perl and we don't want to require that #383837.
-	cd bind/bind-*/ || die
-	eval econf \
-		$(sed -n '/ [.].configure /{s:^[^-]*::;s:>.*::;p}' ../Makefile) \
-		--disable-symtable \
-		--without-make-clean
-}
-
-src_compile() {
-	# build local bind cruft first
-	emake -C bind/bind-*/lib/export install
-	# then build standard dhcp code
-	emake AR="$(tc-getAR)"
-}
-
-src_install() {
-	default
-
-	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
-	dohtml doc/References.html
-
-	if [[ -e client/dhclient ]] ; then
-		# move the client to /
-		dodir /sbin
-		mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
-
-		exeinto /sbin
-		if use kernel_linux ; then
-			newexe "${S}"/client/scripts/linux dhclient-script
-		else
-			newexe "${S}"/client/scripts/freebsd dhclient-script
-		fi
-	fi
-
-	if [[ -e server/dhcpd ]] ; then
-		if use ldap ; then
-			insinto /etc/openldap/schema
-			doins contrib/ldap/dhcp.*
-			dosbin contrib/ldap/dhcpd-conf-to-ldap
-		fi
-
-		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
-		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
-		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
-		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
-		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
-		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
-
-		systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
-		systemd_dounit "${FILESDIR}"/dhcpd4.service
-		systemd_dounit "${FILESDIR}"/dhcpd6.service
-		systemd_dounit "${FILESDIR}"/dhcrelay4.service
-		systemd_dounit "${FILESDIR}"/dhcrelay6.service
-		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
-		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
-
-		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
-	fi
-
-	# the default config files aren't terribly useful #384087
-	local f
-	for f in "${ED}"/etc/dhcp/*.conf.example ; do
-		mv "${f}" "${f%.example}" || die
-	done
-	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
-}
-
-pkg_preinst() {
-	enewgroup dhcp
-	enewuser dhcp -1 -1 /var/lib/dhcp dhcp
-
-	# Keep the user files over the sample ones.  The
-	# hashing is to ignore the crappy defaults #384087.
-	local f h
-	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
-		h=${f#*:}
-		f="/etc/dhcp/${f%:*}.conf"
-		if [ -e "${EROOT}"${f} ] ; then
-			case $(md5sum "${EROOT}"${f}) in
-				${h}*) ;;
-				*) cp -p "${EROOT}"${f} "${ED}"${f};;
-			esac
-		fi
-	done
-}
-
-pkg_postinst() {
-	if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
-		ewarn
-		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
-		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
-		ewarn "and dhcp should be removed from the default runlevel"
-		ewarn
-	fi
-}

diff --git a/net-misc/dhcp/dhcp-4.3.3.ebuild b/net-misc/dhcp/dhcp-4.3.3.ebuild
deleted file mode 100644
index a2c42d4..0000000
--- a/net-misc/dhcp/dhcp-4.3.3.ebuild
+++ /dev/null
@@ -1,255 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-
-inherit eutils systemd toolchain-funcs user
-
-MY_PV="${PV//_alpha/a}"
-MY_PV="${MY_PV//_beta/b}"
-MY_PV="${MY_PV//_rc/rc}"
-MY_PV="${MY_PV//_p/-P}"
-MY_P="${PN}-${MY_PV}"
-DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
-HOMEPAGE="http://www.isc.org/products/DHCP"
-SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
-	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
-
-LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
-IUSE="+client ipv6 kernel_linux ldap selinux +server ssl vim-syntax"
-
-DEPEND="
-	client? (
-		kernel_linux? (
-			ipv6? ( sys-apps/iproute2 )
-			sys-apps/net-tools
-		)
-	)
-	ldap? (
-		net-nds/openldap
-		ssl? ( dev-libs/openssl )
-	)"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-dhcp )
-	vim-syntax? ( app-vim/dhcpd-syntax )"
-
-S="${WORKDIR}/${MY_P}"
-
-src_unpack() {
-	unpack ${A}
-	# handle local bind hell
-	cd "${S}"/bind
-	unpack ./bind.tar.gz
-}
-
-src_prepare() {
-	# Gentoo patches - these will probably never be accepted upstream
-	# Fix some permission issues
-	epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch
-	# Enable dhclient to equery NTP servers
-	epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch
-	epatch "${FILESDIR}"/${PN}-4.3.1-dhclient-resolvconf.patch
-	# Stop downing the interface on Linux as that breaks link daemons
-	# such as wpa_supplicant and netplug
-	epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch
-	# Enable dhclient to get extra configuration from stdin
-	epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-stdin-conf.patch
-	epatch "${FILESDIR}"/${PN}-4.2.2-nogateway.patch #265531
-	epatch "${FILESDIR}"/${PN}-4.2.4-quieter-ping.patch #296921
-	epatch "${FILESDIR}"/${PN}-4.2.4-always-accept-4.patch #437108
-	epatch "${FILESDIR}"/${PN}-4.2.5-iproute2-path.patch #480636
-	epatch "${FILESDIR}"/${PN}-4.2.5-bindtodevice-inet6.patch #471142
-	epatch "${FILESDIR}"/${PN}-4.3.3-ldap-ipv6-client-id.patch #559832
-
-	# Brand the version with Gentoo
-	sed -i \
-		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
-		configure || die
-
-	# Change the hook script locations of the scripts
-	sed -i \
-		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
-		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
-		client/scripts/* || die
-
-	# No need for the linux script to force bash #158540
-	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
-
-	# Quiet the freebsd logger a little
-	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
-
-	# Remove these options from the sample config
-	sed -i -r \
-		-e "/(script|host-name|domain-name) /d" \
-		client/dhclient.conf.example || die
-
-	if use client && ! use server ; then
-		sed -i -r \
-			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
-			Makefile.in || die
-	elif ! use client && use server ; then
-		sed -i -r \
-			-e '/^SUBDIRS/s:\<client\>::' \
-			Makefile.in || die
-	fi
-
-	# Only install different man pages if we don't have en
-	if [[ " ${LINGUAS} " != *" en "* ]]; then
-		# Install Japanese man pages
-		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
-			einfo "Installing Japanese documention"
-			cp doc/ja_JP.eucJP/dhclient* client
-			cp doc/ja_JP.eucJP/dhcp* common
-		fi
-	fi
-	# Now remove the non-english docs so there are no errors later
-	rm -rf doc/ja_JP.eucJP
-
-	# make the bind build work
-	binddir=${S}/bind
-	cd "${binddir}" || die
-	cat <<-EOF > bindvar.tmp
-	binddir=${binddir}
-	GMAKE=${MAKE:-gmake}
-	EOF
-	epatch "${FILESDIR}"/${PN}-4.3.3-bind-disable.patch
-	cd bind-*/
-	epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
-	epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
-}
-
-src_configure() {
-	# bind defaults to stupid `/usr/bin/ar`
-	tc-export AR BUILD_CC
-	export ac_cv_path_AR=${AR}
-
-	# this is tested for by the bind build system, and can cause trouble
-	# when cross-building; since dhcp itself doesn't make use of libcap,
-	# simply disable it.
-	export ac_cv_lib_cap_cap_set_proc=no
-
-	# Use FHS sane paths ... some of these have configure options,
-	# but not all, so just do it all here.
-	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
-	cat <<-EOF >> includes/site.h
-	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
-	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
-	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
-	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
-	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
-	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
-	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
-	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
-	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
-	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
-	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
-	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
-	EOF
-
-	econf \
-		--enable-paranoia \
-		--enable-early-chroot \
-		--sysconfdir=${e} \
-		$(use_enable ipv6 dhcpv6) \
-		$(use_with ldap) \
-		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
-
-	# configure local bind cruft.  symtable option requires
-	# perl and we don't want to require that #383837.
-	cd bind/bind-*/ || die
-	eval econf \
-		$(sed -n '/^bindconfig =/,/^$/{:a;N;$!ba;s,^[^-]*,,;s,\\\s*\n\s*--,--,g;s, @[[:upper:]]\+@,,g;P;D}' ../Makefile.in) \
-		--disable-symtable \
-		--without-make-clean
-}
-
-src_compile() {
-	# build local bind cruft first
-	emake -C bind/bind-*/lib/export install
-	# then build standard dhcp code
-	emake AR="$(tc-getAR)"
-}
-
-src_install() {
-	default
-
-	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
-	dohtml doc/References.html
-
-	if [[ -e client/dhclient ]] ; then
-		# move the client to /
-		dodir /sbin
-		mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
-
-		exeinto /sbin
-		if use kernel_linux ; then
-			newexe "${S}"/client/scripts/linux dhclient-script
-		else
-			newexe "${S}"/client/scripts/freebsd dhclient-script
-		fi
-	fi
-
-	if [[ -e server/dhcpd ]] ; then
-		if use ldap ; then
-			insinto /etc/openldap/schema
-			doins contrib/ldap/dhcp.*
-			dosbin contrib/ldap/dhcpd-conf-to-ldap
-		fi
-
-		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
-		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
-		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
-		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
-		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
-		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
-
-		systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
-		systemd_dounit "${FILESDIR}"/dhcpd4.service
-		systemd_dounit "${FILESDIR}"/dhcpd6.service
-		systemd_dounit "${FILESDIR}"/dhcrelay4.service
-		systemd_dounit "${FILESDIR}"/dhcrelay6.service
-		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
-		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
-
-		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
-	fi
-
-	# the default config files aren't terribly useful #384087
-	local f
-	for f in "${ED}"/etc/dhcp/*.conf.example ; do
-		mv "${f}" "${f%.example}" || die
-	done
-	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
-}
-
-pkg_preinst() {
-	enewgroup dhcp
-	enewuser dhcp -1 -1 /var/lib/dhcp dhcp
-
-	# Keep the user files over the sample ones.  The
-	# hashing is to ignore the crappy defaults #384087.
-	local f h
-	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
-		h=${f#*:}
-		f="/etc/dhcp/${f%:*}.conf"
-		if [ -e "${EROOT}"${f} ] ; then
-			case $(md5sum "${EROOT}"${f}) in
-				${h}*) ;;
-				*) cp -p "${EROOT}"${f} "${ED}"${f};;
-			esac
-		fi
-	done
-}
-
-pkg_postinst() {
-	if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
-		ewarn
-		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
-		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
-		ewarn "and dhcp should be removed from the default runlevel"
-		ewarn
-	fi
-}

diff --git a/net-misc/dhcp/files/dhcp-3.0-paranoia.patch b/net-misc/dhcp/files/dhcp-3.0-paranoia.patch
deleted file mode 100644
index 886f5cb..0000000
--- a/net-misc/dhcp/files/dhcp-3.0-paranoia.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-
-paranoia (non-root/chroot) patch for ISC dhcp 3.0
-file to patch: dhcp-3.0/server/dhcpd.c
-
-update from paranoia patch for ISC dhcp 2.0
-
-Adds 3 options:
-
-	-user <user>
-	-group <group>
-	-chroot <chroot_dir>
-
-Notes:
-	-DPARANOIA must be passed as an argument to the --copts option
-	of configure.  Otherwise, the paranoia code will not be compiled
-	in.  Example:  ./configure --copts -DPARANOIA
-
-	The chroot() call has been delayed in order to allow /dev/log to
-	be reopened after the configuration file has been read.  This is
-	beneficial for systems on which /dev/log is a unix domain socket.
-	The main side effect is that dhcpd.conf should be placed in /etc,
-	instead of <chroot_dir>/etc.
-
-	If dhcpd is to be run on a sysV-style architecture (or, more
-	generally, if /dev/log is a character device), one may opt to
-	create the <chroot_dir>/dev/log character device and add
-	-DEARLY_CHROOT to the --copts option of configure (in addition to
-	-DPARANOIA).  This will perform the chroot() call at the earliest
-	convenience (before reading the configuration file).
-
-	If the -user option is used, the lease and pid file directories
-	should be writable to the server process after it drops
-	privileges.
-
-
-ari edelkind (12/10/2001)
-last modified 12/10/2001
-
-
---- dhcp-3.0/server/dhcpd.c	Thu Jun 21 22:12:58 2001
-+++ dhcp-3.0+paranoia/server/dhcpd.c	Wed Oct 17 08:23:00 2001
-@@ -56,6 +56,16 @@
- #include "version.h"
- #include <omapip/omapip_p.h>
- 
-+#if defined (PARANOIA)
-+#  include <sys/types.h>
-+#  include <unistd.h>
-+#  include <pwd.h>
-+/* get around the ISC declaration of group */
-+#  define group real_group 
-+#    include <grp.h>
-+#  undef group
-+#endif /* PARANOIA */
-+
- static void usage PROTO ((void));
- 
- TIME cur_time;
-@@ -204,6 +214,22 @@
- 	omapi_object_dereference (&listener, MDL);
- }
- 
-+#if defined (PARANOIA)
-+/* to be used in one of two possible scenarios */
-+static void setup_chroot (char *chroot_dir) {
-+	if (geteuid())
-+		log_fatal ("you must be root to use chroot");
-+
-+	if (chroot(chroot_dir)) {
-+		log_fatal ("chroot(\"%s\"): %m", chroot_dir);
-+	}
-+	if (chdir ("/")) {
-+		/* probably permission denied */
-+		log_fatal ("chdir(\"/\"): %m");
-+	}
-+}
-+#endif /* PARANOIA */
-+
- int main (argc, argv, envp)
- 	int argc;
- 	char **argv, **envp;
-@@ -236,6 +262,14 @@
- 	char *traceinfile = (char *)0;
- 	char *traceoutfile = (char *)0;
- #endif
-+#if defined (PARANOIA)
-+	char *set_user   = 0;
-+	char *set_group  = 0;
-+	char *set_chroot = 0;
-+
-+	uid_t set_uid = 0;
-+	gid_t set_gid = 0;
-+#endif /* PARANOIA */
- 
- 	/* Make sure we have stdin, stdout and stderr. */
- 	status = open ("/dev/null", O_RDWR);
-@@ -298,6 +332,20 @@
- 			if (++i == argc)
- 				usage ();
- 			server = argv [i];
-+#if defined (PARANOIA)
-+		} else if (!strcmp (argv [i], "-user")) {
-+			if (++i == argc)
-+				usage ();
-+			set_user = argv [i];
-+		} else if (!strcmp (argv [i], "-group")) {
-+			if (++i == argc)
-+				usage ();
-+			set_group = argv [i];
-+		} else if (!strcmp (argv [i], "-chroot")) {
-+			if (++i == argc)
-+				usage ();
-+			set_chroot = argv [i];
-+#endif /* PARANOIA */
- 		} else if (!strcmp (argv [i], "-cf")) {
- 			if (++i == argc)
- 				usage ();
-@@ -397,6 +445,44 @@
- 					     trace_seed_stop, MDL);
- #endif
- 
-+#if defined (PARANOIA)
-+	/* get user and group info if those options were given */
-+	if (set_user) {
-+		struct passwd *tmp_pwd;
-+
-+		if (geteuid())
-+			log_fatal ("you must be root to set user");
-+
-+		if (!(tmp_pwd = getpwnam(set_user)))
-+			log_fatal ("no such user: %s", set_user);
-+
-+		set_uid = tmp_pwd->pw_uid;
-+
-+		/* use the user's group as the default gid */
-+		if (!set_group)
-+			set_gid = tmp_pwd->pw_gid;
-+	}
-+
-+	if (set_group) {
-+/* get around the ISC declaration of group */
-+#define group real_group
-+		struct group *tmp_grp;
-+
-+		if (geteuid())
-+			log_fatal ("you must be root to set group");
-+
-+		if (!(tmp_grp = getgrnam(set_group)))
-+			log_fatal ("no such group: %s", set_group);
-+
-+		set_gid = tmp_grp->gr_gid;
-+#undef group
-+	}
-+
-+#  if defined (EARLY_CHROOT)
-+	if (set_chroot) setup_chroot (set_chroot);
-+#  endif /* EARLY_CHROOT */
-+#endif /* PARANOIA */
-+
- 	/* Default to the DHCP/BOOTP port. */
- 	if (!local_port)
- 	{
-@@ -500,6 +586,10 @@
- 
- 	postconf_initialization (quiet);
- 
-+#if defined (PARANOIA) && !defined (EARLY_CHROOT)
-+	if (set_chroot) setup_chroot (set_chroot);
-+#endif /* PARANOIA && !EARLY_CHROOT */
-+
-         /* test option should cause an early exit */
-  	if (cftest && !lftest) 
-  		exit(0);
-@@ -543,6 +633,22 @@
- 			exit (0);
- 	}
- 
-+#if defined (PARANOIA)
-+	/* change uid to the specified one */
-+
-+	if (set_gid) {
-+		if (setgroups (0, (void *)0))
-+			log_fatal ("setgroups: %m");
-+		if (setgid (set_gid))
-+			log_fatal ("setgid(%d): %m", (int) set_gid);
-+	}	
-+
-+	if (set_uid) {
-+		if (setuid (set_uid))
-+			log_fatal ("setuid(%d): %m", (int) set_uid);
-+	}
-+#endif /* PARANOIA */
-+
- 	/* Read previous pid file. */
- 	if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) {
- 		status = read (i, pbuf, (sizeof pbuf) - 1);
-@@ -888,6 +994,10 @@
- 
- 	log_fatal ("Usage: dhcpd [-p <UDP port #>] [-d] [-f]%s%s%s%s",
- 		   "\n             [-cf config-file] [-lf lease-file]",
-+#if defined (PARANOIA)
-+		   /* meld into the following string */
-+		   "\n             [-user user] [-group group] [-chroot dir]"
-+#endif /* PARANOIA */
- #if defined (TRACING)
- 		   "\n		   [-tf trace-output-file]",
- 		   "\n		   [-play trace-input-file]",

diff --git a/net-misc/dhcp/files/dhcp-3.1.3-dhclient-no-down.patch b/net-misc/dhcp/files/dhcp-3.1.3-dhclient-no-down.patch
deleted file mode 100644
index 89935df..0000000
--- a/net-misc/dhcp/files/dhcp-3.1.3-dhclient-no-down.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-diff -Nuar --exclude '*.orig' dhcp-3.1.3.orig//client/scripts/linux dhcp-3.1.3//client/scripts/linux
---- dhcp-3.1.3.orig//client/scripts/linux	2010-10-15 04:59:15.890664245 +0000
-+++ dhcp-3.1.3//client/scripts/linux	2010-10-15 05:04:57.940396350 +0000
-@@ -118,7 +118,7 @@
- if [ x$reason = xPREINIT ]; then
-   if [ x$alias_ip_address != x ]; then
-     # Bring down alias interface. Its routes will disappear too.
--    ifconfig $interface:0- inet 0
-+    ifconfig $interface:0- inet 0.0.0.0
-   fi
-   if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
-    then
-@@ -127,7 +127,7 @@
-     # Add route to make broadcast work. Do not omit netmask.
-     route add default dev $interface netmask 0.0.0.0
-   else
--    ifconfig $interface 0 up
-+    ifconfig $interface 0.0.0.0 up
-   fi
- 
-   # We need to give the kernel some time to get the interface up.
-@@ -155,12 +155,12 @@
-   if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
- 		[ x$alias_ip_address != x$old_ip_address ]; then
-     # Possible new alias. Remove old alias.
--    ifconfig $interface:0- inet 0
-+    ifconfig $interface:0- inet 0.0.0.0
-   fi
-   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
-     # IP address changed. Bringing down the interface will delete all routes,
-     # and clear the ARP cache.
--    ifconfig $interface inet 0 down
-+    ifconfig $interface inet 0.0.0.0
- 
-   fi
-   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
-@@ -179,7 +179,7 @@
-   fi
-   if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
-    then
--    ifconfig $interface:0- inet 0
-+    ifconfig $interface:0- inet 0.0.0.0
-     ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
-     route add -host $alias_ip_address $interface:0
-   fi
-@@ -191,11 +191,11 @@
-    || [ x$reason = xSTOP ]; then
-   if [ x$alias_ip_address != x ]; then
-     # Turn off alias interface.
--    ifconfig $interface:0- inet 0
-+    ifconfig $interface:0- inet 0.0.0.0
-   fi
-   if [ x$old_ip_address != x ]; then
-     # Shut down interface, which will delete routes and clear arp cache.
--    ifconfig $interface inet 0 down
-+    ifconfig $interface inet 0.0.0.0
-   fi
-   if [ x$alias_ip_address != x ]; then
-     ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
-@@ -206,7 +206,7 @@
- 
- if [ x$reason = xTIMEOUT ]; then
-   if [ x$alias_ip_address != x ]; then
--    ifconfig $interface:0- inet 0
-+    ifconfig $interface:0- inet 0.0.0.0
-   fi
-   ifconfig $interface inet $new_ip_address $new_subnet_arg \
- 					$new_broadcast_arg $mtu_arg
-@@ -227,7 +227,7 @@
-     make_resolv_conf
-     exit_with_hooks 0
-   fi
--  ifconfig $interface inet 0 down
-+  ifconfig $interface inet 0.0.0.0
-   exit_with_hooks 1
- fi
- 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2016-03-30 10:23 Lars Wendler
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Wendler @ 2016-03-30 10:23 UTC (permalink / raw
  To: gentoo-commits

commit:     8e7ee61b36033f35517f0a4287efb6973e02d979
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 30 10:21:10 2016 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Mar 30 10:23:15 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e7ee61b

net-misc/dhcp: Bump to version 4.3.4

Package-Manager: portage-2.2.28
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 net-misc/dhcp/Manifest                            |   1 +
 net-misc/dhcp/dhcp-4.3.4.ebuild                   | 265 ++++++++++++++++++++++
 net-misc/dhcp/files/dhcp-4.3.4-bind-disable.patch |  38 ++++
 net-misc/dhcp/files/dhcp-4.3.4-dhclient-ntp.patch | 209 +++++++++++++++++
 4 files changed, 513 insertions(+)

diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
index 783e943..c6a6536 100644
--- a/net-misc/dhcp/Manifest
+++ b/net-misc/dhcp/Manifest
@@ -2,3 +2,4 @@ DIST dhcp-4.2.5-P1.tar.gz 8255960 SHA256 59b06c9f5d775e46999b422c45b9229402c462b
 DIST dhcp-4.3.1.tar.gz 8980806 SHA256 266cbca8a7a6bb8f9ccc5765da0d2b04099329314a54a4fc1022d510ad3e9af0 SHA512 84ca525fda825bf367a98754f1fb1b8eba5b095c92c25ddaec6e30b31008c7d5c43062ae43cecaa43731a8e78ae406a3123906fd402d2ba4b46b7adbae65aa6a WHIRLPOOL 3fd3720f6883b43856d2169264ee2adfb541b793604728c4e5cc3b647d4a88d6245fb6e53062de4118301cc15f0b4388363eba304bf3623dfb88c91bde94b2b6
 DIST dhcp-4.3.3-P1.tar.gz 9204043 SHA256 c11e896dffa1bfbc49462965d3f6dec45534e34068603546d9a236f2aa669921 SHA512 7e14268b4acaa82c807af9d956f76f4327a9a75d36273a244fef74dbd54e7506e8b38ce6035e56f61ab09a19bfc0a40599f76c89dc342514f1048b5ac3b2a0eb WHIRLPOOL a0a6873e2f1625cfa208c328ed2d6ec507e239456d6eba24f5731a83ba16f5fbb36f0d6d99fd33fb9045cbf051116196a57c6c2ded2b36e93964475ad29d2b0e
 DIST dhcp-4.3.3.tar.gz 9205539 SHA256 553c4945b09b1c1b904c4780f34f72aaefa2fc8c6556715de0bc9d4e3d255ede SHA512 33671816e21456ffec57e2c9ab2d129377096b4e2e5b4ca8194dcd9495c6a9e18a2a5e79d4f05694f3dc841895aa0adb63afd7bd6fe4641eb5a80d3fd7e715d9 WHIRLPOOL 27e7f2fdd1f1f7b3309b444a67e21d139468317538345cc3599e6a47f20489fa5d07018eabe8e32c429f2f16f03c28b22b29bff2ab08972f541c63603bd3df9a
+DIST dhcp-4.3.4.tar.gz 9302513 SHA256 f5115aee3dd3e6925de4ba47b80ab732ba48b481c8364b6ebade2d43698d607e SHA512 411c3f0e1effedb2a95f00539d13164530a56b50830008eb78906b3c8bf4070c331cf54a431770aed5d1b6ba214840446964210060674f746781cc97842ad706 WHIRLPOOL ea283592268c8efabd7fec430bd21c45306822b9275c91ee1e604d09e92f9eb3c50941ea11ecd9dcb230caec3b8e6ee94958e8eb6375e0ca0e7a64a8aaf63bce

diff --git a/net-misc/dhcp/dhcp-4.3.4.ebuild b/net-misc/dhcp/dhcp-4.3.4.ebuild
new file mode 100644
index 0000000..9b8f963
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.3.4.ebuild
@@ -0,0 +1,265 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils systemd toolchain-funcs user
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="+client ipv6 kernel_linux ldap libressl selinux +server ssl vim-syntax"
+
+DEPEND="
+	client? (
+		kernel_linux? (
+			ipv6? ( sys-apps/iproute2 )
+			sys-apps/net-tools
+		)
+	)
+	ldap? (
+		net-nds/openldap
+		ssl? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+	)"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-dhcp )
+	vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+	unpack ${A}
+	# handle local bind hell
+	cd "${S}"/bind
+	unpack ./bind.tar.gz
+}
+
+PATCHES=(
+	# Gentoo patches - these will probably never be accepted upstream
+	# Fix some permission issues
+	"${FILESDIR}/${PN}-3.0-fix-perms.patch"
+
+	# Enable dhclient to equery NTP servers
+	"${FILESDIR}/${PN}-4.3.4-dhclient-ntp.patch"
+	"${FILESDIR}/${PN}-4.3.1-dhclient-resolvconf.patch"
+
+	# Stop downing the interface on Linux as that breaks link daemons
+	# such as wpa_supplicant and netplug
+	"${FILESDIR}/${PN}-3.0.3-dhclient-no-down.patch"
+
+	# Enable dhclient to get extra configuration from stdin
+	"${FILESDIR}/${PN}-4.2.2-dhclient-stdin-conf.patch"
+	"${FILESDIR}/${PN}-4.2.2-nogateway.patch" #265531
+	"${FILESDIR}/${PN}-4.2.4-quieter-ping.patch" #296921
+	"${FILESDIR}/${PN}-4.2.4-always-accept-4.patch" #437108
+	"${FILESDIR}/${PN}-4.2.5-iproute2-path.patch" #480636
+	"${FILESDIR}/${PN}-4.2.5-bindtodevice-inet6.patch" #471142
+	"${FILESDIR}/${PN}-4.3.3-ldap-ipv6-client-id.patch" #559832
+)
+
+src_prepare() {
+	epatch "${PATCHES[@]}"
+
+	# Brand the version with Gentoo
+	sed -i \
+		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
+		configure || die
+
+	# Change the hook script locations of the scripts
+	sed -i \
+		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+		client/scripts/* || die
+
+	# No need for the linux script to force bash #158540
+	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+	# Quiet the freebsd logger a little
+	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+	# Remove these options from the sample config
+	sed -i -r \
+		-e "/(script|host-name|domain-name) /d" \
+		client/dhclient.conf.example || die
+
+	if use client && ! use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+			Makefile.in || die
+	elif ! use client && use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<client\>::' \
+			Makefile.in || die
+	fi
+
+	# Only install different man pages if we don't have en
+	if [[ " ${LINGUAS} " != *" en "* ]]; then
+		# Install Japanese man pages
+		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+			einfo "Installing Japanese documention"
+			cp doc/ja_JP.eucJP/dhclient* client
+			cp doc/ja_JP.eucJP/dhcp* common
+		fi
+	fi
+	# Now remove the non-english docs so there are no errors later
+	rm -rf doc/ja_JP.eucJP
+
+	# make the bind build work
+	binddir=${S}/bind
+	cd "${binddir}" || die
+	cat <<-EOF > bindvar.tmp
+	binddir=${binddir}
+	GMAKE=${MAKE:-gmake}
+	EOF
+	epatch "${FILESDIR}"/${PN}-4.3.4-bind-disable.patch
+	cd bind-*/
+	epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
+	epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
+}
+
+src_configure() {
+	# bind defaults to stupid `/usr/bin/ar`
+	tc-export AR BUILD_CC
+	export ac_cv_path_AR=${AR}
+
+	# this is tested for by the bind build system, and can cause trouble
+	# when cross-building; since dhcp itself doesn't make use of libcap,
+	# simply disable it.
+	export ac_cv_lib_cap_cap_set_proc=no
+
+	# Use FHS sane paths ... some of these have configure options,
+	# but not all, so just do it all here.
+	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+	cat <<-EOF >> includes/site.h
+	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
+	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
+	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
+	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
+	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
+	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
+	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
+	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
+	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
+	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
+	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
+	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
+	EOF
+
+	econf \
+		--enable-paranoia \
+		--enable-early-chroot \
+		--sysconfdir=${e} \
+		$(use_enable ipv6 dhcpv6) \
+		$(use_with ldap) \
+		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+
+	# configure local bind cruft.  symtable option requires
+	# perl and we don't want to require that #383837.
+	cd bind/bind-*/ || die
+	eval econf \
+		$(sed -n '/^bindconfig =/,/^$/{:a;N;$!ba;s,^[^-]*,,;s,\\\s*\n\s*--,--,g;s, @[[:upper:]]\+@,,g;P;D}' ../Makefile.in) \
+		--disable-symtable \
+		--without-make-clean
+}
+
+src_compile() {
+	# build local bind cruft first
+	emake -C bind/bind-*/lib/export install
+	# then build standard dhcp code
+	emake AR="$(tc-getAR)"
+}
+
+src_install() {
+	default
+
+	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+	dohtml doc/References.html
+
+	if [[ -e client/dhclient ]] ; then
+		# move the client to /
+		dodir /sbin
+		mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
+
+		exeinto /sbin
+		if use kernel_linux ; then
+			newexe "${S}"/client/scripts/linux dhclient-script
+		else
+			newexe "${S}"/client/scripts/freebsd dhclient-script
+		fi
+	fi
+
+	if [[ -e server/dhcpd ]] ; then
+		if use ldap ; then
+			insinto /etc/openldap/schema
+			doins contrib/ldap/dhcp.*
+			dosbin contrib/ldap/dhcpd-conf-to-ldap
+		fi
+
+		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
+		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
+		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
+		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
+
+		systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
+		systemd_dounit "${FILESDIR}"/dhcpd4.service
+		systemd_dounit "${FILESDIR}"/dhcpd6.service
+		systemd_dounit "${FILESDIR}"/dhcrelay4.service
+		systemd_dounit "${FILESDIR}"/dhcrelay6.service
+		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
+		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
+
+		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
+	fi
+
+	# the default config files aren't terribly useful #384087
+	local f
+	for f in "${ED}"/etc/dhcp/*.conf.example ; do
+		mv "${f}" "${f%.example}" || die
+	done
+	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
+}
+
+pkg_preinst() {
+	enewgroup dhcp
+	enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+
+	# Keep the user files over the sample ones.  The
+	# hashing is to ignore the crappy defaults #384087.
+	local f h
+	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+		h=${f#*:}
+		f="/etc/dhcp/${f%:*}.conf"
+		if [ -e "${EROOT}"${f} ] ; then
+			case $(md5sum "${EROOT}"${f}) in
+				${h}*) ;;
+				*) cp -p "${EROOT}"${f} "${ED}"${f};;
+			esac
+		fi
+	done
+}
+
+pkg_postinst() {
+	if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+		ewarn
+		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+		ewarn "and dhcp should be removed from the default runlevel"
+		ewarn
+	fi
+}

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
new file mode 100644
index 0000000..be0c032
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.4-bind-disable.patch
@@ -0,0 +1,38 @@
+--- dhcp-4.3.4/bind/Makefile.in
++++ dhcp-4.3.4/bind/Makefile.in
+@@ -40,6 +40,7 @@
+ @BIND_ATF_TRUE@all: bind1 atf bind2
+ 
+ bind1:
++disable:
+ # Extract the source from the tarball, if it hasn't been already.
+ 	@if test -d ${bindsrcdir} ; then                    \
+ 		echo ${bindsrcdir} already unpacked... ;    \
+@@ -68,6 +69,7 @@
+ 	fi
+ 
+ atf:
++disable:
+ # Build and copy the ATF support if not yet installed.
+ 	@if test -d ./atf ; then				      \
+ 		echo ATF support already installed ;		      \
+@@ -82,6 +84,7 @@
+ @CROSS_COMPILING_TRUE@bind2: bind2-hostgen
+ 
+ bind2-noguest:
++disable:
+ # Build and install the export libraries
+ # No need to do anything if we already have something installed.
+ 	@if test -d ${binddir}/lib ; then                                    \
+@@ -98,6 +101,7 @@
+ 	fi
+ 
+ bind2-hostgen:
++disable:
+ # Build and install the export libraries
+ # No need to do anything if we already have something installed.
+ 	@if test -d ${binddir}/lib ; then                                    \
+--- dhcp-4.3.4/bind/test
++++ dhcp-4.3.4/bind/test
+@@ -0,0 +1 @@
++--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

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
new file mode 100644
index 0000000..2076317
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.4-dhclient-ntp.patch
@@ -0,0 +1,209 @@
+--- dhcp-4.3.4/client/clparse.c
++++ dhcp-4.3.4/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.4/client/scripts/bsdos
++++ dhcp-4.3.4/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.4/client/scripts/freebsd
++++ dhcp-4.3.4/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.4/client/scripts/linux
++++ dhcp-4.3.4/client/scripts/linux
+@@ -65,6 +65,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.4/client/scripts/netbsd
++++ dhcp-4.3.4/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.4/client/scripts/openbsd
++++ dhcp-4.3.4/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.4/client/scripts/solaris
++++ dhcp-4.3.4/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.


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2017-08-01  7:46 Lars Wendler
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Wendler @ 2017-08-01  7:46 UTC (permalink / raw
  To: gentoo-commits

commit:     ba88569985ba83cd2fd5035028ee599fca26f622
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  1 07:45:50 2017 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Aug  1 07:46:05 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba885699

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 <AT> gentoo.org>

 net-misc/dhcp/Manifest                             |   1 +
 net-misc/dhcp/dhcp-4.3.6.ebuild                    | 262 +++++++++++++
 net-misc/dhcp/files/dhcp-3.0-fix-perms.patch       |   4 +-
 .../dhcp/files/dhcp-3.0.3-dhclient-no-down.patch   |   4 +-
 net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch  | 210 ++++++++++
 .../files/dhcp-4.3.6-dhclient-resolvconf.patch     | 422 +++++++++++++++++++++
 net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch |  11 +
 net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch     |  66 ++++
 net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch  |  66 ++++
 9 files changed, 1042 insertions(+), 4 deletions(-)

diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
index 3341a295d95..075efb60c20 100644
--- a/net-misc/dhcp/Manifest
+++ b/net-misc/dhcp/Manifest
@@ -1,2 +1,3 @@
 DIST dhcp-4.3.4.tar.gz 9302513 SHA256 f5115aee3dd3e6925de4ba47b80ab732ba48b481c8364b6ebade2d43698d607e SHA512 411c3f0e1effedb2a95f00539d13164530a56b50830008eb78906b3c8bf4070c331cf54a431770aed5d1b6ba214840446964210060674f746781cc97842ad706 WHIRLPOOL ea283592268c8efabd7fec430bd21c45306822b9275c91ee1e604d09e92f9eb3c50941ea11ecd9dcb230caec3b8e6ee94958e8eb6375e0ca0e7a64a8aaf63bce
 DIST dhcp-4.3.5.tar.gz 10075147 SHA256 eb95936bf15d2393c55dd505bc527d1d4408289cec5a9fa8abb99f7577e7f954 SHA512 aba0e1d361eb9e7ed33fc48c0b0b9288057af9ec51775e40e27feb9ababc182506706fcf39079236ce36b0f7ded391e107474dc29de2e60ed45d37753505e1f0 WHIRLPOOL 85012016d81efb7654ec417e7a0f1a6145e8e143b13d6d9470d0fb7caf37c035441d5b2b8849d332f8ad0a9a6509bb0b931ac8f207f7ba9104e96811c0360124
+DIST dhcp-4.3.6.tar.gz 10182593 SHA256 a41eaf6364f1377fe065d35671d9cf82bbbc8f21207819b2b9f33f652aec6f1b SHA512 de4962dc2aa174df17a3a1456719a777a42d238c3d6ad1771ccc460fa70c9e9cefcce52c7437f7acde61b9c3a2e84e9d49fd2dc33c7e9243053ceed5b247be03 WHIRLPOOL 1617687cd2144a09e2fe32b6e9bf49fcdb32f96c2979051f4c0826860eb59572c64c821d8de119f40e5546bc6132773a01702ba76c11be28a28c2926d9ed5c98

diff --git a/net-misc/dhcp/dhcp-4.3.6.ebuild b/net-misc/dhcp/dhcp-4.3.6.ebuild
new file mode 100644
index 00000000000..2404129b81e
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.3.6.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd toolchain-funcs user
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="+client ipv6 kernel_linux ldap libressl selinux +server ssl vim-syntax"
+
+DEPEND="
+	client? (
+		kernel_linux? (
+			ipv6? ( sys-apps/iproute2 )
+			sys-apps/net-tools
+		)
+	)
+	ldap? (
+		net-nds/openldap
+		ssl? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+	)"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-dhcp )
+	vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+	unpack ${A}
+	# handle local bind hell
+	cd "${S}"/bind
+	unpack ./bind.tar.gz
+}
+
+PATCHES=(
+	# Gentoo patches - these will probably never be accepted upstream
+	# Fix some permission issues
+	"${FILESDIR}/${PN}-3.0-fix-perms.patch"
+
+	# Enable dhclient to equery NTP servers
+	"${FILESDIR}/${PN}-4.3.6-dhclient-ntp.patch"
+	"${FILESDIR}/${PN}-4.3.6-dhclient-resolvconf.patch"
+
+	# Enable dhclient to get extra configuration from stdin
+	"${FILESDIR}/${PN}-4.2.2-dhclient-stdin-conf.patch"
+	"${FILESDIR}/${PN}-4.3.6-nogateway.patch" #265531
+	"${FILESDIR}/${PN}-4.3.6-quieter-ping.patch" #296921
+	"${FILESDIR}/${PN}-4.2.4-always-accept-4.patch" #437108
+	"${FILESDIR}/${PN}-4.3.6-iproute2-path.patch" #480636
+	"${FILESDIR}/${PN}-4.2.5-bindtodevice-inet6.patch" #471142
+	"${FILESDIR}/${PN}-4.3.3-ldap-ipv6-client-id.patch" #559832
+)
+
+src_prepare() {
+	default
+
+	# Brand the version with Gentoo
+	sed -i \
+		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
+		configure || die
+
+	# Change the hook script locations of the scripts
+	sed -i \
+		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+		client/scripts/* || die
+
+	# No need for the linux script to force bash #158540
+	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+	# Quiet the freebsd logger a little
+	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+	# Remove these options from the sample config
+	sed -i -r \
+		-e "/(script|host-name|domain-name) /d" \
+		client/dhclient.conf.example || die
+
+	if use client && ! use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+			Makefile.in || die
+	elif ! use client && use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<client\>::' \
+			Makefile.in || die
+	fi
+
+	# Only install different man pages if we don't have en
+	if [[ " ${LINGUAS} " != *" en "* ]]; then
+		# Install Japanese man pages
+		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+			einfo "Installing Japanese documention"
+			cp doc/ja_JP.eucJP/dhclient* client || die
+			cp doc/ja_JP.eucJP/dhcp* common || die
+		fi
+	fi
+	# Now remove the non-english docs so there are no errors later
+	rm -r doc/ja_JP.eucJP || die
+
+	# make the bind build work
+	binddir="${S}/bind"
+	cd "${binddir}" || die
+	cat <<-EOF > bindvar.tmp
+	binddir=${binddir}
+	GMAKE=${MAKE:-gmake}
+	EOF
+	eapply -p2 "${FILESDIR}"/${PN}-4.3.4-bind-disable.patch
+	cd bind-*/ || die
+	eapply -p2 "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
+}
+
+src_configure() {
+	# bind defaults to stupid `/usr/bin/ar`
+	tc-export AR BUILD_CC
+	export ac_cv_path_AR=${AR}
+
+	# this is tested for by the bind build system, and can cause trouble
+	# when cross-building; since dhcp itself doesn't make use of libcap,
+	# simply disable it.
+	export ac_cv_lib_cap_cap_set_proc=no
+
+	# Use FHS sane paths ... some of these have configure options,
+	# but not all, so just do it all here.
+	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+	cat <<-EOF >> includes/site.h
+	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
+	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
+	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
+	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
+	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
+	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
+	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
+	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
+	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
+	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
+	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
+	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
+	EOF
+
+	local myeconfargs=(
+		--enable-paranoia
+		--enable-early-chroot
+		--sysconfdir=${e}
+		$(use_enable ipv6 dhcpv6)
+		$(use_with ldap)
+		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+	)
+	econf "${myeconfargs[@]}"
+
+	# configure local bind cruft.  symtable option requires
+	# perl and we don't want to require that #383837.
+	cd bind/bind-*/ || die
+	eval econf \
+		$(sed -n '/^bindconfig =/,/^$/{:a;N;$!ba;s,^[^-]*,,;s,\\\s*\n\s*--,--,g;s, @[[:upper:]]\+@,,g;P;D}' ../Makefile.in) \
+		--disable-symtable \
+		--without-make-clean
+}
+
+src_compile() {
+	# build local bind cruft first
+	emake -C bind/bind-*/lib/export install
+	# then build standard dhcp code
+	emake AR="$(tc-getAR)"
+}
+
+src_install() {
+	default
+
+	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+	docinto html
+	dodoc doc/References.html
+
+	if [[ -e client/dhclient ]] ; then
+		# move the client to /
+		dodir /sbin
+		mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
+
+		exeinto /sbin
+		if use kernel_linux ; then
+			newexe "${S}"/client/scripts/linux dhclient-script
+		else
+			newexe "${S}"/client/scripts/freebsd dhclient-script
+		fi
+	fi
+
+	if [[ -e server/dhcpd ]] ; then
+		if use ldap ; then
+			insinto /etc/openldap/schema
+			doins contrib/ldap/dhcp.*
+			dosbin contrib/ldap/dhcpd-conf-to-ldap
+		fi
+
+		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
+		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
+		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
+		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
+
+		systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
+		systemd_dounit "${FILESDIR}"/dhcpd4.service
+		systemd_dounit "${FILESDIR}"/dhcpd6.service
+		systemd_dounit "${FILESDIR}"/dhcrelay4.service
+		systemd_dounit "${FILESDIR}"/dhcrelay6.service
+		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
+		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
+
+		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
+	fi
+
+	# the default config files aren't terribly useful #384087
+	local f
+	for f in "${ED}"/etc/dhcp/*.conf.example ; do
+		mv "${f}" "${f%.example}" || die
+	done
+	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
+}
+
+pkg_preinst() {
+	enewgroup dhcp
+	enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+
+	# Keep the user files over the sample ones.  The
+	# hashing is to ignore the crappy defaults #384087.
+	local f h
+	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+		h=${f#*:}
+		f="/etc/dhcp/${f%:*}.conf"
+		if [ -e "${EROOT}"${f} ] ; then
+			case $(md5sum "${EROOT}"${f}) in
+				${h}*) ;;
+				*) cp -p "${EROOT}"${f} "${ED}"${f};;
+			esac
+		fi
+	done
+}
+
+pkg_postinst() {
+	if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+		ewarn
+		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+		ewarn "and dhcp should be removed from the default runlevel"
+		ewarn
+	fi
+}

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 13debb20ed0..f4b3fd18e16 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 518efec11c5..3a3b956e361 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 00000000000..a504840dd5a
--- /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 00000000000..ccfdbcf4a20
--- /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 00000000000..18b04e620c1
--- /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 00000000000..d299cc503f6
--- /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 00000000000..3efb6459ebf
--- /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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2017-09-19 22:44 Tony Vroon
  0 siblings, 0 replies; 11+ messages in thread
From: Tony Vroon @ 2017-09-19 22:44 UTC (permalink / raw
  To: gentoo-commits

commit:     34e2a1385458f4d62dcc5fb01cd62700704141be
Author:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 19 22:43:56 2017 +0000
Commit:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
CommitDate: Tue Sep 19 22:44:17 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34e2a138

net-misc/dhcp: --without-lmdb not valid in embedded BIND.

Package-Manager: portage-2.3.8

 net-misc/dhcp/dhcp-4.3.6-r1.ebuild                | 263 ++++++++++++++++++++++
 net-misc/dhcp/files/dhcp-4.3.6-lmdb-removal.patch |  12 +
 2 files changed, 275 insertions(+)

diff --git a/net-misc/dhcp/dhcp-4.3.6-r1.ebuild b/net-misc/dhcp/dhcp-4.3.6-r1.ebuild
new file mode 100644
index 00000000000..32b0629c937
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.3.6-r1.ebuild
@@ -0,0 +1,263 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd toolchain-funcs user
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="+client ipv6 kernel_linux ldap libressl selinux +server ssl vim-syntax"
+
+DEPEND="
+	client? (
+		kernel_linux? (
+			ipv6? ( sys-apps/iproute2 )
+			sys-apps/net-tools
+		)
+	)
+	ldap? (
+		net-nds/openldap
+		ssl? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+	)"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-dhcp )
+	vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+	unpack ${A}
+	# handle local bind hell
+	cd "${S}"/bind
+	unpack ./bind.tar.gz
+}
+
+PATCHES=(
+	# Gentoo patches - these will probably never be accepted upstream
+	# Fix some permission issues
+	"${FILESDIR}/${PN}-3.0-fix-perms.patch"
+
+	# Enable dhclient to equery NTP servers
+	"${FILESDIR}/${PN}-4.3.6-dhclient-ntp.patch"
+	"${FILESDIR}/${PN}-4.3.6-dhclient-resolvconf.patch"
+
+	# Enable dhclient to get extra configuration from stdin
+	"${FILESDIR}/${PN}-4.2.2-dhclient-stdin-conf.patch"
+	"${FILESDIR}/${PN}-4.3.6-nogateway.patch" #265531
+	"${FILESDIR}/${PN}-4.3.6-quieter-ping.patch" #296921
+	"${FILESDIR}/${PN}-4.2.4-always-accept-4.patch" #437108
+	"${FILESDIR}/${PN}-4.3.6-iproute2-path.patch" #480636
+	"${FILESDIR}/${PN}-4.2.5-bindtodevice-inet6.patch" #471142
+	"${FILESDIR}/${PN}-4.3.3-ldap-ipv6-client-id.patch" #559832
+	"${FILESDIR}/${PN}-4.3.6-lmdb-removal.patch" #628598
+)
+
+src_prepare() {
+	default
+
+	# Brand the version with Gentoo
+	sed -i \
+		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
+		configure || die
+
+	# Change the hook script locations of the scripts
+	sed -i \
+		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+		client/scripts/* || die
+
+	# No need for the linux script to force bash #158540
+	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+	# Quiet the freebsd logger a little
+	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+	# Remove these options from the sample config
+	sed -i -r \
+		-e "/(script|host-name|domain-name) /d" \
+		client/dhclient.conf.example || die
+
+	if use client && ! use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+			Makefile.in || die
+	elif ! use client && use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<client\>::' \
+			Makefile.in || die
+	fi
+
+	# Only install different man pages if we don't have en
+	if [[ " ${LINGUAS} " != *" en "* ]]; then
+		# Install Japanese man pages
+		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+			einfo "Installing Japanese documention"
+			cp doc/ja_JP.eucJP/dhclient* client || die
+			cp doc/ja_JP.eucJP/dhcp* common || die
+		fi
+	fi
+	# Now remove the non-english docs so there are no errors later
+	rm -r doc/ja_JP.eucJP || die
+
+	# make the bind build work
+	binddir="${S}/bind"
+	cd "${binddir}" || die
+	cat <<-EOF > bindvar.tmp
+	binddir=${binddir}
+	GMAKE=${MAKE:-gmake}
+	EOF
+	eapply -p2 "${FILESDIR}"/${PN}-4.3.4-bind-disable.patch
+	cd bind-*/ || die
+	eapply -p2 "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
+}
+
+src_configure() {
+	# bind defaults to stupid `/usr/bin/ar`
+	tc-export AR BUILD_CC
+	export ac_cv_path_AR=${AR}
+
+	# this is tested for by the bind build system, and can cause trouble
+	# when cross-building; since dhcp itself doesn't make use of libcap,
+	# simply disable it.
+	export ac_cv_lib_cap_cap_set_proc=no
+
+	# Use FHS sane paths ... some of these have configure options,
+	# but not all, so just do it all here.
+	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+	cat <<-EOF >> includes/site.h
+	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
+	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
+	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
+	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
+	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
+	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
+	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
+	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
+	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
+	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
+	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
+	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
+	EOF
+
+	local myeconfargs=(
+		--enable-paranoia
+		--enable-early-chroot
+		--sysconfdir=${e}
+		$(use_enable ipv6 dhcpv6)
+		$(use_with ldap)
+		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+	)
+	econf "${myeconfargs[@]}"
+
+	# configure local bind cruft.  symtable option requires
+	# perl and we don't want to require that #383837.
+	cd bind/bind-*/ || die
+	eval econf \
+		$(sed -n '/^bindconfig =/,/^$/{:a;N;$!ba;s,^[^-]*,,;s,\\\s*\n\s*--,--,g;s, @[[:upper:]]\+@,,g;P;D}' ../Makefile.in) \
+		--disable-symtable \
+		--without-make-clean
+}
+
+src_compile() {
+	# build local bind cruft first
+	emake -C bind/bind-*/lib/export install
+	# then build standard dhcp code
+	emake AR="$(tc-getAR)"
+}
+
+src_install() {
+	default
+
+	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+	docinto html
+	dodoc doc/References.html
+
+	if [[ -e client/dhclient ]] ; then
+		# move the client to /
+		dodir /sbin
+		mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
+
+		exeinto /sbin
+		if use kernel_linux ; then
+			newexe "${S}"/client/scripts/linux dhclient-script
+		else
+			newexe "${S}"/client/scripts/freebsd dhclient-script
+		fi
+	fi
+
+	if [[ -e server/dhcpd ]] ; then
+		if use ldap ; then
+			insinto /etc/openldap/schema
+			doins contrib/ldap/dhcp.*
+			dosbin contrib/ldap/dhcpd-conf-to-ldap
+		fi
+
+		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
+		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
+		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
+		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
+
+		systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
+		systemd_dounit "${FILESDIR}"/dhcpd4.service
+		systemd_dounit "${FILESDIR}"/dhcpd6.service
+		systemd_dounit "${FILESDIR}"/dhcrelay4.service
+		systemd_dounit "${FILESDIR}"/dhcrelay6.service
+		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
+		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
+
+		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
+	fi
+
+	# the default config files aren't terribly useful #384087
+	local f
+	for f in "${ED}"/etc/dhcp/*.conf.example ; do
+		mv "${f}" "${f%.example}" || die
+	done
+	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
+}
+
+pkg_preinst() {
+	enewgroup dhcp
+	enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+
+	# Keep the user files over the sample ones.  The
+	# hashing is to ignore the crappy defaults #384087.
+	local f h
+	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+		h=${f#*:}
+		f="/etc/dhcp/${f%:*}.conf"
+		if [ -e "${EROOT}"${f} ] ; then
+			case $(md5sum "${EROOT}"${f}) in
+				${h}*) ;;
+				*) cp -p "${EROOT}"${f} "${ED}"${f};;
+			esac
+		fi
+	done
+}
+
+pkg_postinst() {
+	if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+		ewarn
+		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+		ewarn "and dhcp should be removed from the default runlevel"
+		ewarn
+	fi
+}

diff --git a/net-misc/dhcp/files/dhcp-4.3.6-lmdb-removal.patch b/net-misc/dhcp/files/dhcp-4.3.6-lmdb-removal.patch
new file mode 100644
index 00000000000..6f80d7401f5
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-lmdb-removal.patch
@@ -0,0 +1,12 @@
+diff -uNr dhcp-4.3.6.ORIG/bind/Makefile.in dhcp-4.3.6/bind/Makefile.in
+--- dhcp-4.3.6.ORIG/bind/Makefile.in	2017-09-19 23:37:59.459485673 +0100
++++ dhcp-4.3.6/bind/Makefile.in	2017-09-19 23:38:19.970484566 +0100
+@@ -28,7 +28,7 @@
+ 
+ bindconfig = --disable-kqueue --disable-epoll --disable-devpoll \
+ 	--without-openssl --without-libxml2 --enable-exportlib \
+-	--with-gssapi=no --enable-threads=no --without-lmdb @BINDCONFIG@ \
++	--with-gssapi=no --enable-threads=no @BINDCONFIG@ \
+ 	--with-export-includedir=${binddir}/include \
+ 	--with-export-libdir=${binddir}/lib
+ 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2020-11-18 17:09 Mike Gilbert
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Gilbert @ 2020-11-18 17:09 UTC (permalink / raw
  To: gentoo-commits

commit:     9b7959a9776a912bdef36f4db14c3c7bb23ddf34
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 18 17:08:22 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Nov 18 17:08:22 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b7959a9

net-misc/dhcp: pull in network-online.target in service units

dhcpd refuses to start if there are no configured broadcast interfaces.

Closes: https://bugs.gentoo.org/628920
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-misc/dhcp/{dhcp-4.4.2-r2.ebuild => dhcp-4.4.2-r3.ebuild} | 0
 net-misc/dhcp/files/dhcpd4.service                           | 2 ++
 net-misc/dhcp/files/dhcpd6.service                           | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/net-misc/dhcp/dhcp-4.4.2-r2.ebuild b/net-misc/dhcp/dhcp-4.4.2-r3.ebuild
similarity index 100%
rename from net-misc/dhcp/dhcp-4.4.2-r2.ebuild
rename to net-misc/dhcp/dhcp-4.4.2-r3.ebuild

diff --git a/net-misc/dhcp/files/dhcpd4.service b/net-misc/dhcp/files/dhcpd4.service
index b064bd9b57d..8197ace1210 100644
--- a/net-misc/dhcp/files/dhcpd4.service
+++ b/net-misc/dhcp/files/dhcpd4.service
@@ -3,6 +3,8 @@ Description=DHCPv4 Server Daemon
 Documentation=man:dhcpd(8) man:dhcpd.conf(5)
 After=network.target
 After=time-sync.target
+After=network-online.target
+Wants=network-online.target
 
 [Service]
 ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcp -group dhcp --no-pid

diff --git a/net-misc/dhcp/files/dhcpd6.service b/net-misc/dhcp/files/dhcpd6.service
index 603cacd8eb8..7f41db0a72b 100644
--- a/net-misc/dhcp/files/dhcpd6.service
+++ b/net-misc/dhcp/files/dhcpd6.service
@@ -3,6 +3,8 @@ Description=DHCPv6 Server Daemon
 Documentation=man:dhcpd(8) man:dhcpd.conf(5)
 After=network.target
 After=time-sync.target
+After=network-online.target
+Wants=network-online.target
 
 [Service]
 ExecStart=/usr/sbin/dhcpd -f -s -6 -cf /etc/dhcp/dhcpd.conf -user dhcp -group dhcp --no-pid


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2020-11-20 19:29 Mike Gilbert
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Gilbert @ 2020-11-20 19:29 UTC (permalink / raw
  To: gentoo-commits

commit:     65f86cdce2f35d916c5f3c41fd41900f3bf6bedb
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 20 19:29:17 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Nov 20 19:29:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65f86cdc

net-misc/dhcp: backport build fix

Closes: https://bugs.gentoo.org/752402
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-misc/dhcp/dhcp-4.4.2-r3.ebuild                 |  1 +
 net-misc/dhcp/files/dhcp-4.4.2-variable-name.patch | 25 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/net-misc/dhcp/dhcp-4.4.2-r3.ebuild b/net-misc/dhcp/dhcp-4.4.2-r3.ebuild
index 0257824a08f..6cad24e7519 100644
--- a/net-misc/dhcp/dhcp-4.4.2-r3.ebuild
+++ b/net-misc/dhcp/dhcp-4.4.2-r3.ebuild
@@ -70,6 +70,7 @@ PATCHES=(
 
 	# Possible upstream candidates
 	"${FILESDIR}/${PN}-4.4.2-fno-common.patch" #710194
+	"${FILESDIR}/dhcp-4.4.2-variable-name.patch" #752402
 )
 
 src_prepare() {

diff --git a/net-misc/dhcp/files/dhcp-4.4.2-variable-name.patch b/net-misc/dhcp/files/dhcp-4.4.2-variable-name.patch
new file mode 100644
index 00000000000..9f5085dd5e2
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.4.2-variable-name.patch
@@ -0,0 +1,25 @@
+From 261c84d91d1b4581df9f7f0ec031908299de7726 Mon Sep 17 00:00:00 2001
+From: Mark Andrews <marka@isc.org>
+Date: Thu, 19 Dec 2019 09:27:44 +1100
+Subject: [PATCH] fix variable name in conditional block
+
+---
+ lib/isc/stats.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/isc/stats.c b/lib/isc/stats.c
+index 5bce3c1100..a7ab97ce53 100644
+--- a/bind/bind-9.11.14/lib/isc/stats.c
++++ b/bind/bind-9.11.14/lib/isc/stats.c
+@@ -297,7 +297,7 @@ setcounter(isc_stats_t *stats,
+ 	isc_atomic_store((int32_t *)&stats->counters[counter].lo,
+ 			 (uint32_t)(value & 0xffffffff));
+ # else
+-	stats->counters[counter] = val;
++	stats->counters[counter] = value;
+ # endif
+ #endif
+ }
+-- 
+GitLab
+


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2022-10-14 18:26 David Seifert
  0 siblings, 0 replies; 11+ messages in thread
From: David Seifert @ 2022-10-14 18:26 UTC (permalink / raw
  To: gentoo-commits

commit:     5516475e7648dc3c46a680475f1f3c9124ce88a7
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 14 18:25:26 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri Oct 14 18:25:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5516475e

net-misc/dhcp: rebase patches

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-misc/dhcp/dhcp-4.4.3_p1.ebuild                 | 20 +++++-----
 ...pt-4.patch => dhcp-4.4.3-always-accept-4.patch} |  0
 ...6.patch => dhcp-4.4.3-bindtodevice-inet6.patch} | 11 +++---
 ...ent-ntp.patch => dhcp-4.4.3-dhclient-ntp.patch} |  0
 ....patch => dhcp-4.4.3-dhclient-resolvconf.patch} | 44 +++++++++++-----------
 ....patch => dhcp-4.4.3-dhclient-stdin-conf.patch} |  0
 ...-fix-perms.patch => dhcp-4.4.3-fix-perms.patch} |  6 +--
 ...2-path.patch => dhcp-4.4.3-iproute2-path.patch} |  0
 ....patch => dhcp-4.4.3-ldap-ipv6-client-id.patch} |  0
 ...-nogateway.patch => dhcp-4.4.3-nogateway.patch} |  0
 ...er-ping.patch => dhcp-4.4.3-quieter-ping.patch} |  0
 11 files changed, 40 insertions(+), 41 deletions(-)

diff --git a/net-misc/dhcp/dhcp-4.4.3_p1.ebuild b/net-misc/dhcp/dhcp-4.4.3_p1.ebuild
index 9db36ddb42da..e425d52ea36c 100644
--- a/net-misc/dhcp/dhcp-4.4.3_p1.ebuild
+++ b/net-misc/dhcp/dhcp-4.4.3_p1.ebuild
@@ -50,26 +50,26 @@ src_unpack() {
 PATCHES=(
 	# Gentoo patches - these will probably never be accepted upstream
 	# Fix some permission issues
-	"${FILESDIR}/${PN}-3.0-fix-perms.patch"
+	"${FILESDIR}/${PN}-4.4.3-fix-perms.patch"
 
 	# Enable dhclient to equery NTP servers
-	"${FILESDIR}/${PN}-4.3.6-dhclient-ntp.patch"
-	"${FILESDIR}/${PN}-4.3.6-dhclient-resolvconf.patch"
+	"${FILESDIR}/${PN}-4.4.3-dhclient-ntp.patch"
+	"${FILESDIR}/${PN}-4.4.3-dhclient-resolvconf.patch"
 
 	# Enable dhclient to get extra configuration from stdin
-	"${FILESDIR}/${PN}-4.2.2-dhclient-stdin-conf.patch"
+	"${FILESDIR}/${PN}-4.4.3-dhclient-stdin-conf.patch"
 	# bug #265531
-	"${FILESDIR}/${PN}-4.3.6-nogateway.patch"
+	"${FILESDIR}/${PN}-4.4.3-nogateway.patch"
 	# bug #296921
-	"${FILESDIR}/${PN}-4.3.6-quieter-ping.patch"
+	"${FILESDIR}/${PN}-4.4.3-quieter-ping.patch"
 	# bug #437108
-	"${FILESDIR}/${PN}-4.4.0-always-accept-4.patch"
+	"${FILESDIR}/${PN}-4.4.3-always-accept-4.patch"
 	# bug #480636
-	"${FILESDIR}/${PN}-4.3.6-iproute2-path.patch"
+	"${FILESDIR}/${PN}-4.4.3-iproute2-path.patch"
 	# bug #471142
-	"${FILESDIR}/${PN}-4.2.5-bindtodevice-inet6.patch"
+	"${FILESDIR}/${PN}-4.4.3-bindtodevice-inet6.patch"
 	# bug #559832
-	"${FILESDIR}/${PN}-4.3.3-ldap-ipv6-client-id.patch"
+	"${FILESDIR}/${PN}-4.4.3-ldap-ipv6-client-id.patch"
 
 	# Possible upstream candidates
 )

diff --git a/net-misc/dhcp/files/dhcp-4.4.0-always-accept-4.patch b/net-misc/dhcp/files/dhcp-4.4.3-always-accept-4.patch
similarity index 100%
rename from net-misc/dhcp/files/dhcp-4.4.0-always-accept-4.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-always-accept-4.patch

diff --git a/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch b/net-misc/dhcp/files/dhcp-4.4.3-bindtodevice-inet6.patch
similarity index 51%
rename from net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-bindtodevice-inet6.patch
index 77254c32e2b0..f6ea0f858c6d 100644
--- a/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch
+++ b/net-misc/dhcp/files/dhcp-4.4.3-bindtodevice-inet6.patch
@@ -5,15 +5,14 @@ snipped from fedora
 # dhclient -6: bind socket to interface (#1001742)
 # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #34784])
 
-diff -up dhcp-4.2.5/common/socket.c.bindtodevice_inet6 dhcp-4.2.5/common/socket.c
---- dhcp-4.2.5/common/socket.c.bindtodevice_inet6	2013-09-17 16:47:05.000000000 +0200
-+++ dhcp-4.2.5/common/socket.c	2013-09-17 16:48:18.975997842 +0200
-@@ -245,7 +245,7 @@ if_register_socket(struct interface_info
+--- a/common/socket.c
++++ b/common/socket.c
+@@ -266,7 +266,7 @@
  
  #if defined(SO_BINDTODEVICE)
  	/* Bind this socket to this interface. */
 -	if ((local_family != AF_INET6) && (info->ifp != NULL) &&
 +	if (((do_multicast == 0)||(*do_multicast == 0)) && (info->ifp != NULL) &&
  	    setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE,
- 			(char *)(info -> ifp), sizeof(*(info -> ifp))) < 0) {
- 		log_fatal("setsockopt: SO_BINDTODEVICE: %m");
+ 		       (char *)(info -> ifp), sizeof(*(info -> ifp))) < 0) {
+ 		log_fatal("Can't set SO_BINDTODEVICE on dhcp socket for"

diff --git a/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch b/net-misc/dhcp/files/dhcp-4.4.3-dhclient-ntp.patch
similarity index 100%
rename from net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-dhclient-ntp.patch

diff --git a/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-4.4.3-dhclient-resolvconf.patch
similarity index 95%
rename from net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-dhclient-resolvconf.patch
index ccfdbcf4a206..63a67b7b1151 100644
--- a/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch
+++ b/net-misc/dhcp/files/dhcp-4.4.3-dhclient-resolvconf.patch
@@ -1,5 +1,5 @@
---- dhcp-4.3.6/client/scripts/bsdos
-+++ dhcp-4.3.6/client/scripts/bsdos
+--- a/client/scripts/bsdos
++++ b/client/scripts/bsdos
 @@ -1,27 +1,25 @@
  #!/bin/sh
  
@@ -55,10 +55,10 @@
 +      chmod 644 /etc/resolv.conf
 +    fi
    fi
- }
- 
---- dhcp-4.3.6/client/scripts/freebsd
-+++ dhcp-4.3.6/client/scripts/freebsd
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
+--- a/client/scripts/freebsd
++++ b/client/scripts/freebsd
 @@ -11,54 +11,23 @@
  fi
  
@@ -160,9 +160,9 @@
 +      chmod 644 /etc/resolv.conf
      fi
    fi
- }
---- dhcp-4.3.6/client/scripts/linux
-+++ dhcp-4.3.6/client/scripts/linux
+   # If we're making confs, may as well make an ntp.conf too
+--- a/client/scripts/linux
++++ b/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.
@@ -248,10 +248,10 @@
  	fi
 -        mv -f $new_resolv_conf /etc/resolv.conf
      fi
- }
  
---- dhcp-4.3.6/client/scripts/netbsd
-+++ dhcp-4.3.6/client/scripts/netbsd
+     # If we're making confs, may as well make an ntp.conf too
+--- a/client/scripts/netbsd
++++ b/client/scripts/netbsd
 @@ -1,27 +1,25 @@
  #!/bin/sh
  
@@ -308,10 +308,10 @@
 +      chmod 644 /etc/resolv.conf
 +    fi
    fi
- }
- 
---- dhcp-4.3.6/client/scripts/openbsd
-+++ dhcp-4.3.6/client/scripts/openbsd
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
+--- a/client/scripts/openbsd
++++ b/client/scripts/openbsd
 @@ -1,27 +1,25 @@
  #!/bin/sh
  
@@ -369,10 +369,10 @@
 +      chmod 644 /etc/resolv.conf
 +    fi
    fi
- }
- 
---- dhcp-4.3.6/client/scripts/solaris
-+++ dhcp-4.3.6/client/scripts/solaris
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
+--- a/client/scripts/solaris
++++ b/client/scripts/solaris
 @@ -1,21 +1,39 @@
  #!/bin/sh  
  
@@ -418,5 +418,5 @@
 +      chmod 644 /etc/resolv.conf
 +    fi
    fi
- }
- 
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf

diff --git a/net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch b/net-misc/dhcp/files/dhcp-4.4.3-dhclient-stdin-conf.patch
similarity index 100%
rename from net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-dhclient-stdin-conf.patch

diff --git a/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch b/net-misc/dhcp/files/dhcp-4.4.3-fix-perms.patch
similarity index 79%
rename from net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-fix-perms.patch
index f4b3fd18e167..5b3a8ab2c20a 100644
--- a/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
+++ b/net-misc/dhcp/files/dhcp-4.4.3-fix-perms.patch
@@ -1,6 +1,6 @@
 --- a/server/dhcpd.c
 +++ b/server/dhcpd.c
-@@ -602,6 +602,12 @@
+@@ -892,6 +892,12 @@
  	if (lftest)
  		exit (0);
  
@@ -11,5 +11,5 @@
 +#endif /* PARANOIA */
 +
  	/* Discover all the network interfaces and initialize them. */
- 	discover_interfaces (DISCOVER_SERVER);
- 
+ #if defined(DHCPv6) && defined(DHCP4o6)
+ 	if (dhcpv4_over_dhcpv6) {

diff --git a/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch b/net-misc/dhcp/files/dhcp-4.4.3-iproute2-path.patch
similarity index 100%
rename from net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-iproute2-path.patch

diff --git a/net-misc/dhcp/files/dhcp-4.3.3-ldap-ipv6-client-id.patch b/net-misc/dhcp/files/dhcp-4.4.3-ldap-ipv6-client-id.patch
similarity index 100%
rename from net-misc/dhcp/files/dhcp-4.3.3-ldap-ipv6-client-id.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-ldap-ipv6-client-id.patch

diff --git a/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch b/net-misc/dhcp/files/dhcp-4.4.3-nogateway.patch
similarity index 100%
rename from net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-nogateway.patch

diff --git a/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch b/net-misc/dhcp/files/dhcp-4.4.3-quieter-ping.patch
similarity index 100%
rename from net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch
rename to net-misc/dhcp/files/dhcp-4.4.3-quieter-ping.patch


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2023-01-20  3:48 Mike Gilbert
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Gilbert @ 2023-01-20  3:48 UTC (permalink / raw
  To: gentoo-commits

commit:     d71420bcf88260155b49c4ff294003189e5cba60
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 20 03:44:24 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Jan 20 03:44:24 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d71420bc

net-misc/dhcp: tweak /var/lib/dhcp creation

Drop the keepdir from src_install.
Update the modes in the tmpfiles.d file, and install it unconditionally.

Closes: https://bugs.gentoo.org/891347
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild | 293 ++++++++++++++++++++++++++++++++++
 net-misc/dhcp/files/dhcp.tmpfiles     |   2 +
 2 files changed, 295 insertions(+)

diff --git a/net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild b/net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild
new file mode 100644
index 000000000000..f2efd63970a9
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild
@@ -0,0 +1,293 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit systemd toolchain-funcs flag-o-matic tmpfiles
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="https://www.isc.org/dhcp"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="MPL-2.0 BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="+client ipv6 ldap selinux +server ssl vim-syntax"
+
+BDEPEND="
+	acct-group/dhcp
+	acct-user/dhcp"
+
+DEPEND="
+	client? (
+		kernel_linux? (
+			ipv6? ( sys-apps/iproute2 )
+			sys-apps/net-tools
+		)
+	)
+	ldap? (
+		net-nds/openldap:=
+		ssl? ( dev-libs/openssl:= )
+	)"
+RDEPEND="
+	${BDEPEND}
+	${DEPEND}
+	selinux? ( sec-policy/selinux-dhcp )
+	vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+	unpack ${A}
+	# handle local bind hell
+	cd "${S}"/bind
+	unpack ./bind.tar.gz
+}
+
+PATCHES=(
+	# Gentoo patches - these will probably never be accepted upstream
+	# Fix some permission issues
+	"${FILESDIR}/${PN}-4.4.3-fix-perms.patch"
+
+	# Enable dhclient to equery NTP servers
+	"${FILESDIR}/${PN}-4.4.3-dhclient-ntp.patch"
+	"${FILESDIR}/${PN}-4.4.3-dhclient-resolvconf.patch"
+
+	# Enable dhclient to get extra configuration from stdin
+	"${FILESDIR}/${PN}-4.4.3-dhclient-stdin-conf.patch"
+	# bug #265531
+	"${FILESDIR}/${PN}-4.4.3-nogateway.patch"
+	# bug #296921
+	"${FILESDIR}/${PN}-4.4.3-quieter-ping.patch"
+	# bug #437108
+	"${FILESDIR}/${PN}-4.4.3-always-accept-4.patch"
+	# bug #480636
+	"${FILESDIR}/${PN}-4.4.3-iproute2-path.patch"
+	# bug #471142
+	"${FILESDIR}/${PN}-4.4.3-bindtodevice-inet6.patch"
+	# bug #559832
+	"${FILESDIR}/${PN}-4.4.3-ldap-ipv6-client-id.patch"
+
+	# Possible upstream candidates
+)
+
+src_prepare() {
+	default
+
+	# Brand the version with Gentoo
+	sed -i \
+		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
+		configure || die
+
+	# Change the hook script locations of the scripts
+	sed -i \
+		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+		client/scripts/* || die
+
+	# No need for the linux script to force bash #158540
+	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+	# Quiet the freebsd logger a little
+	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+	# Remove these options from the sample config
+	sed -i -r \
+		-e "/(script|host-name|domain-name) /d" \
+		client/dhclient.conf.example || die
+
+	if use client && ! use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+			Makefile.in || die
+	elif ! use client && use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<client\>::' \
+			Makefile.in || die
+	fi
+
+	# Only install different man pages if we don't have en
+	if [[ " ${LINGUAS} " != *" en "* ]]; then
+		# Install Japanese man pages
+		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+			einfo "Installing Japanese documention"
+			cp doc/ja_JP.eucJP/dhclient* client || die
+			cp doc/ja_JP.eucJP/dhcp* common || die
+		fi
+	fi
+	# Now remove the non-english docs so there are no errors later
+	rm -r doc/ja_JP.eucJP || die
+
+	# make the bind build work - do NOT make "binddir" local!
+	binddir="${S}/bind"
+	cd "${binddir}" || die
+	cat <<-EOF > bindvar.tmp
+	binddir=${binddir}
+	GMAKE=${MAKE:-gmake}
+	EOF
+	eapply -p2 "${FILESDIR}"/${PN}-4.4.3-bind-disable.patch
+	# Only use the relevant subdirs now that ISC
+	#removed the lib/export structure in bind.
+	sed '/^SUBDIRS/s@=.*$@= isc dns isccfg irs samples@' \
+		-i bind-*/lib/Makefile.in || die
+}
+
+src_configure() {
+	# bind defaults to stupid `/usr/bin/ar`
+	tc-export AR BUILD_CC
+	export ac_cv_path_AR=${AR}
+
+	# this is tested for by the bind build system, and can cause trouble
+	# when cross-building; since dhcp itself doesn't make use of libcap,
+	# simply disable it.
+	export ac_cv_lib_cap_cap_set_proc=no
+
+	# Use FHS sane paths ... some of these have configure options,
+	# but not all, so just do it all here.
+	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+	cat <<-EOF >> includes/site.h
+	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
+	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
+	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
+	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
+	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
+	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
+	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
+	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
+	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
+	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
+	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
+	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
+	EOF
+
+	# Breaks with -O3 because of reliance on undefined behaviour
+	# bug #787935
+	append-flags -fno-strict-aliasing
+
+	# bug #720806, bug #801592
+	if use ppc || use arm || use hppa || [[ ${CHOST} == i486* ]] ; then
+		append-libs -latomic
+	fi
+
+	local myeconfargs=(
+		--enable-paranoia
+		--enable-early-chroot
+		--sysconfdir=${e}
+		--with-randomdev=/dev/random
+		$(use_enable ipv6 dhcpv6)
+		$(use_with ldap)
+		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+		LIBS="${LIBS}"
+	)
+	econf "${myeconfargs[@]}"
+
+	# configure local bind cruft.  symtable option requires
+	# perl and we don't want to require that. bug #383837.
+	cd bind/bind-*/ || die
+	local el
+	eval econf \
+		$(for el in $(awk '/^bindconfig/,/^$/ {print}' ../Makefile.in) ; do if [[ ${el} =~ ^-- ]] ; then printf ' %s' ${el//\\} ; fi ; done | sed 's,@\([[:alpha:]]\+\)dir@,${binddir}/\1,g') \
+		--with-randomdev=/dev/random \
+		--disable-symtable \
+		--without-make-clean
+}
+
+src_compile() {
+	# Build local bind cruft first
+	emake -C bind/bind-*/lib install
+	# then build standard dhcp code
+	emake AR="$(tc-getAR)"
+}
+
+src_install() {
+	default
+
+	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+	docinto html
+	dodoc doc/References.html
+	newtmpfiles "${FILESDIR}"/dhcp.tmpfiles dhcp.conf
+
+	if [[ -e client/dhclient ]] ; then
+		# Move the client to /
+		dodir /sbin
+		mv "${ED}"/usr/sbin/dhclient "${ED}"/sbin/ || die
+
+		exeinto /sbin
+		if use kernel_linux ; then
+			newexe "${S}"/client/scripts/linux dhclient-script
+		else
+			newexe "${S}"/client/scripts/freebsd dhclient-script
+		fi
+	fi
+
+	if [[ -e server/dhcpd ]] ; then
+		if use ldap ; then
+			insinto /etc/openldap/schema
+			doins contrib/ldap/dhcp.*
+			dosbin contrib/ldap/dhcpd-conf-to-ldap
+		fi
+
+		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
+		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
+		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
+		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
+
+		systemd_dounit "${FILESDIR}"/dhcpd4.service
+		systemd_dounit "${FILESDIR}"/dhcpd6.service
+		systemd_dounit "${FILESDIR}"/dhcrelay4.service
+		systemd_dounit "${FILESDIR}"/dhcrelay6.service
+		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
+		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
+
+		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
+	fi
+
+	# the default config files aren't terribly useful #384087
+	local f
+	for f in "${ED}"/etc/dhcp/*.conf.example ; do
+		mv "${f}" "${f%.example}" || die
+	done
+	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
+}
+
+pkg_preinst() {
+	# Keep the user files over the sample ones.  The
+	# hashing is to ignore the crappy defaults #384087.
+	local f h
+	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+		h=${f#*:}
+		f="/etc/dhcp/${f%:*}.conf"
+		if [ -e "${EROOT}"${f} ] ; then
+			case $(md5sum "${EROOT}"${f}) in
+				${h}*) ;;
+				*) cp -p "${EROOT}"${f} "${ED}"${f};;
+			esac
+		fi
+	done
+}
+
+pkg_postinst() {
+	tmpfiles_process dhcp.conf
+
+	if use client ; then
+		ewarn "The client and relay functionality will be removed in the next release!"
+		ewarn "Upstream have decided to discontinue this functionality."
+	fi
+
+	if [[ -e "${EROOT}"/etc/init.d/dhcp ]] ; then
+		ewarn
+		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+		ewarn "and dhcp should be removed from the default runlevel"
+		ewarn
+	fi
+}

diff --git a/net-misc/dhcp/files/dhcp.tmpfiles b/net-misc/dhcp/files/dhcp.tmpfiles
new file mode 100644
index 000000000000..c5b18352eda4
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/dhcp 0750 dhcp dhcp
+f /var/lib/dhcp/dhcpd.leases 0640 dhcp dhcp


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2023-04-28  6:26 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2023-04-28  6:26 UTC (permalink / raw
  To: gentoo-commits

commit:     8c680f270b865d00a05f08ed03e042d27fb76fc0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 28 06:25:28 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 28 06:25:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c680f27

net-misc/dhcp: fix configure w/ clang 16

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild              | 294 +++++++++++++++++++++
 .../dhcp/files/dhcp-4.4.3-configure-clang16.patch  | 143 ++++++++++
 2 files changed, 437 insertions(+)

diff --git a/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild b/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild
new file mode 100644
index 000000000000..60785dbffa15
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild
@@ -0,0 +1,294 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit systemd toolchain-funcs flag-o-matic tmpfiles
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="https://www.isc.org/dhcp"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="MPL-2.0 BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+IUSE="+client ipv6 ldap selinux +server ssl vim-syntax"
+
+BDEPEND="
+	acct-group/dhcp
+	acct-user/dhcp"
+
+DEPEND="
+	client? (
+		kernel_linux? (
+			ipv6? ( sys-apps/iproute2 )
+			sys-apps/net-tools
+		)
+	)
+	ldap? (
+		net-nds/openldap:=
+		ssl? ( dev-libs/openssl:= )
+	)"
+RDEPEND="
+	${BDEPEND}
+	${DEPEND}
+	selinux? ( sec-policy/selinux-dhcp )
+	vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+	unpack ${A}
+	# handle local bind hell
+	cd "${S}"/bind
+	unpack ./bind.tar.gz
+}
+
+PATCHES=(
+	# Gentoo patches - these will probably never be accepted upstream
+	# Fix some permission issues
+	"${FILESDIR}/${PN}-4.4.3-fix-perms.patch"
+
+	# Enable dhclient to equery NTP servers
+	"${FILESDIR}/${PN}-4.4.3-dhclient-ntp.patch"
+	"${FILESDIR}/${PN}-4.4.3-dhclient-resolvconf.patch"
+
+	# Enable dhclient to get extra configuration from stdin
+	"${FILESDIR}/${PN}-4.4.3-dhclient-stdin-conf.patch"
+	# bug #265531
+	"${FILESDIR}/${PN}-4.4.3-nogateway.patch"
+	# bug #296921
+	"${FILESDIR}/${PN}-4.4.3-quieter-ping.patch"
+	# bug #437108
+	"${FILESDIR}/${PN}-4.4.3-always-accept-4.patch"
+	# bug #480636
+	"${FILESDIR}/${PN}-4.4.3-iproute2-path.patch"
+	# bug #471142
+	"${FILESDIR}/${PN}-4.4.3-bindtodevice-inet6.patch"
+	# bug #559832
+	"${FILESDIR}/${PN}-4.4.3-ldap-ipv6-client-id.patch"
+
+	# Possible upstream candidates
+	"${FILESDIR}/${PN}-4.4.3-configure-clang16.patch"
+)
+
+src_prepare() {
+	default
+
+	# Brand the version with Gentoo
+	sed -i \
+		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
+		configure || die
+
+	# Change the hook script locations of the scripts
+	sed -i \
+		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+		client/scripts/* || die
+
+	# No need for the linux script to force bash #158540
+	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+	# Quiet the freebsd logger a little
+	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+	# Remove these options from the sample config
+	sed -i -r \
+		-e "/(script|host-name|domain-name) /d" \
+		client/dhclient.conf.example || die
+
+	if use client && ! use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+			Makefile.in || die
+	elif ! use client && use server ; then
+		sed -i -r \
+			-e '/^SUBDIRS/s:\<client\>::' \
+			Makefile.in || die
+	fi
+
+	# Only install different man pages if we don't have en
+	if [[ " ${LINGUAS} " != *" en "* ]]; then
+		# Install Japanese man pages
+		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+			einfo "Installing Japanese documention"
+			cp doc/ja_JP.eucJP/dhclient* client || die
+			cp doc/ja_JP.eucJP/dhcp* common || die
+		fi
+	fi
+	# Now remove the non-english docs so there are no errors later
+	rm -r doc/ja_JP.eucJP || die
+
+	# make the bind build work - do NOT make "binddir" local!
+	binddir="${S}/bind"
+	cd "${binddir}" || die
+	cat <<-EOF > bindvar.tmp
+	binddir=${binddir}
+	GMAKE=${MAKE:-gmake}
+	EOF
+	eapply -p2 "${FILESDIR}"/${PN}-4.4.3-bind-disable.patch
+	# Only use the relevant subdirs now that ISC
+	#removed the lib/export structure in bind.
+	sed '/^SUBDIRS/s@=.*$@= isc dns isccfg irs samples@' \
+		-i bind-*/lib/Makefile.in || die
+}
+
+src_configure() {
+	# bind defaults to stupid `/usr/bin/ar`
+	tc-export AR BUILD_CC
+	export ac_cv_path_AR=${AR}
+
+	# this is tested for by the bind build system, and can cause trouble
+	# when cross-building; since dhcp itself doesn't make use of libcap,
+	# simply disable it.
+	export ac_cv_lib_cap_cap_set_proc=no
+
+	# Use FHS sane paths ... some of these have configure options,
+	# but not all, so just do it all here.
+	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+	cat <<-EOF >> includes/site.h
+	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
+	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
+	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
+	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
+	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
+	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
+	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
+	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
+	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
+	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
+	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
+	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
+	EOF
+
+	# Breaks with -O3 because of reliance on undefined behaviour
+	# bug #787935
+	append-flags -fno-strict-aliasing
+
+	# bug #720806, bug #801592
+	if use ppc || use arm || use hppa || [[ ${CHOST} == i486* ]] ; then
+		append-libs -latomic
+	fi
+
+	local myeconfargs=(
+		--enable-paranoia
+		--enable-early-chroot
+		--sysconfdir=${e}
+		--with-randomdev=/dev/random
+		$(use_enable ipv6 dhcpv6)
+		$(use_with ldap)
+		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+		LIBS="${LIBS}"
+	)
+	econf "${myeconfargs[@]}"
+
+	# configure local bind cruft.  symtable option requires
+	# perl and we don't want to require that. bug #383837.
+	cd bind/bind-*/ || die
+	local el
+	eval econf \
+		$(for el in $(awk '/^bindconfig/,/^$/ {print}' ../Makefile.in) ; do if [[ ${el} =~ ^-- ]] ; then printf ' %s' ${el//\\} ; fi ; done | sed 's,@\([[:alpha:]]\+\)dir@,${binddir}/\1,g') \
+		--with-randomdev=/dev/random \
+		--disable-symtable \
+		--without-make-clean
+}
+
+src_compile() {
+	# Build local bind cruft first
+	emake -C bind/bind-*/lib install
+	# then build standard dhcp code
+	emake AR="$(tc-getAR)"
+}
+
+src_install() {
+	default
+
+	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+	docinto html
+	dodoc doc/References.html
+	newtmpfiles "${FILESDIR}"/dhcp.tmpfiles dhcp.conf
+
+	if [[ -e client/dhclient ]] ; then
+		# Move the client to /
+		dodir /sbin
+		mv "${ED}"/usr/sbin/dhclient "${ED}"/sbin/ || die
+
+		exeinto /sbin
+		if use kernel_linux ; then
+			newexe "${S}"/client/scripts/linux dhclient-script
+		else
+			newexe "${S}"/client/scripts/freebsd dhclient-script
+		fi
+	fi
+
+	if [[ -e server/dhcpd ]] ; then
+		if use ldap ; then
+			insinto /etc/openldap/schema
+			doins contrib/ldap/dhcp.*
+			dosbin contrib/ldap/dhcpd-conf-to-ldap
+		fi
+
+		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
+		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
+		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
+		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
+
+		systemd_dounit "${FILESDIR}"/dhcpd4.service
+		systemd_dounit "${FILESDIR}"/dhcpd6.service
+		systemd_dounit "${FILESDIR}"/dhcrelay4.service
+		systemd_dounit "${FILESDIR}"/dhcrelay6.service
+		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
+		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
+
+		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
+	fi
+
+	# the default config files aren't terribly useful #384087
+	local f
+	for f in "${ED}"/etc/dhcp/*.conf.example ; do
+		mv "${f}" "${f%.example}" || die
+	done
+	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
+}
+
+pkg_preinst() {
+	# Keep the user files over the sample ones.  The
+	# hashing is to ignore the crappy defaults #384087.
+	local f h
+	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+		h=${f#*:}
+		f="/etc/dhcp/${f%:*}.conf"
+		if [ -e "${EROOT}"${f} ] ; then
+			case $(md5sum "${EROOT}"${f}) in
+				${h}*) ;;
+				*) cp -p "${EROOT}"${f} "${ED}"${f};;
+			esac
+		fi
+	done
+}
+
+pkg_postinst() {
+	tmpfiles_process dhcp.conf
+
+	if use client ; then
+		ewarn "The client and relay functionality will be removed in the next release!"
+		ewarn "Upstream have decided to discontinue this functionality."
+	fi
+
+	if [[ -e "${EROOT}"/etc/init.d/dhcp ]] ; then
+		ewarn
+		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+		ewarn "and dhcp should be removed from the default runlevel"
+		ewarn
+	fi
+}

diff --git a/net-misc/dhcp/files/dhcp-4.4.3-configure-clang16.patch b/net-misc/dhcp/files/dhcp-4.4.3-configure-clang16.patch
new file mode 100644
index 000000000000..38c24ff9f2bb
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.4.3-configure-clang16.patch
@@ -0,0 +1,143 @@
+https://src.fedoraproject.org/rpms/dhcp/blob/5a0c1922defd9dbb94fa7d9fd3294031ffe72df9/f/0030-bind-configure-c99.patch
+
+Downstream-only patch.
+Upstream bind9 development has changed configure significantly:
+https://gitlab.isc.org/isc-projects/bind9
+
+From 035224d94d4cf93257cf5440a2e4e129540e81e8 Mon Sep 17 00:00:00 2001
+From: Arjun Shankar <arjun@redhat.com>
+Date: Thu, 20 Apr 2023 15:34:01 +0200
+Subject: [PATCH] Port to C99
+
+--- a/bind/bind-9.11.36/configure
++++ b/bind/bind-9.11.36/configure
+@@ -20016,7 +20016,7 @@ else
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+-main() {
++int main() {
+ char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+@@ -20056,7 +20056,7 @@ else
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+-main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
++int main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
+ 			     inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
+ 			     (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }
+ _ACEOF
+@@ -21346,7 +21346,7 @@ else
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+-main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
++int main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: int" >&5
+@@ -21363,7 +21363,7 @@ else
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+-main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
++int main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: long int" >&5
+@@ -21380,7 +21380,7 @@ else
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+-main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
++int main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: long long int" >&5
+@@ -21759,7 +21759,7 @@ int
+ main ()
+ {
+ 
+-				main() { asm("ics"); exit(0); }
++				int main() { asm("ics"); exit(0); }
+ 
+   ;
+   return 0;
+@@ -21782,7 +21782,7 @@ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+-				main() { asm("ics"); exit(0); }
++				int main() { asm("ics"); exit(0); }
+ 
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+--- a/bind/bind-9.11.36/configure.ac
++++ b/bind/bind-9.11.36/configure.ac
+@@ -3274,7 +3274,7 @@ AC_TRY_RUN([
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+-main() {
++int main() {
+ char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
+ 	[AC_MSG_RESULT(yes)
+ 	ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
+@@ -3297,7 +3297,7 @@ AC_TRY_RUN([
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+-main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
++int main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
+ 			     inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
+ 			     (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
+ 	[AC_MSG_RESULT(yes)
+@@ -3901,7 +3901,7 @@ AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+-main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
++int main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
+ [AC_MSG_RESULT(int)
+ ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
+ [
+@@ -3909,7 +3909,7 @@ AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+-main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
++int main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
+ [AC_MSG_RESULT(long int)
+ ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
+ [
+@@ -3917,7 +3917,7 @@ AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+-main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
++int main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
+ [AC_MSG_RESULT(long long int)
+ ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
+ [AC_MSG_ERROR([unable to determine sizeof rlim_cur])
+@@ -4117,7 +4117,7 @@ case "$enable_atomic" in
+ 			if test "X$GCC" = "Xyes"; then
+ 				AC_MSG_CHECKING([if asm("ics"); works])
+ 				AC_TRY_COMPILE(,[
+-				main() { asm("ics"); exit(0); }
++				int main() { asm("ics"); exit(0); }
+ 				],
+ 				[AC_MSG_RESULT(yes)
+ 				 use_atomic=yes],
+@@ -4125,7 +4125,7 @@ case "$enable_atomic" in
+ 				saved_cflags="$CFLAGS"
+ 				CFLAGS="$CFLAGS -Wa,-many"
+ 				AC_TRY_RUN([
+-				main() { asm("ics"); exit(0); }
++				int main() { asm("ics"); exit(0); }
+ 				],
+ 				[AC_MSG_RESULT([yes, required -Wa,-many])
+ 				 use_atomic=yes],
+-- 
+2.40.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2023-05-21 20:38 Mike Gilbert
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Gilbert @ 2023-05-21 20:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c9ffaa149a270cf3da67bceb9eb31541aa668810
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun May 21 20:36:04 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun May 21 20:36:04 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9ffaa14

net-misc/dhcp: drop broken LD_PRELOAD setting

Closes: https://bugs.gentoo.org/836405
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild              | 293 ---------------------
 net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild              |   3 +-
 ...-4.4.3_p1-r2.ebuild => dhcp-4.4.3_p1-r3.ebuild} |   0
 net-misc/dhcp/files/dhcpd.init5                    |   2 -
 4 files changed, 1 insertion(+), 297 deletions(-)

diff --git a/net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild b/net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild
deleted file mode 100644
index 9fa84b982375..000000000000
--- a/net-misc/dhcp/dhcp-4.4.3_p1-r1.ebuild
+++ /dev/null
@@ -1,293 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit systemd toolchain-funcs flag-o-matic tmpfiles
-
-MY_PV="${PV//_alpha/a}"
-MY_PV="${MY_PV//_beta/b}"
-MY_PV="${MY_PV//_rc/rc}"
-MY_PV="${MY_PV//_p/-P}"
-MY_P="${PN}-${MY_PV}"
-
-DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
-HOMEPAGE="https://www.isc.org/dhcp"
-SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
-	ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
-
-LICENSE="MPL-2.0 BSD SSLeay GPL-2" # GPL-2 only for init script
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-IUSE="+client ipv6 ldap selinux +server ssl vim-syntax"
-
-BDEPEND="
-	acct-group/dhcp
-	acct-user/dhcp"
-
-DEPEND="
-	client? (
-		kernel_linux? (
-			ipv6? ( sys-apps/iproute2 )
-			sys-apps/net-tools
-		)
-	)
-	ldap? (
-		net-nds/openldap:=
-		ssl? ( dev-libs/openssl:= )
-	)"
-RDEPEND="
-	${BDEPEND}
-	${DEPEND}
-	selinux? ( sec-policy/selinux-dhcp )
-	vim-syntax? ( app-vim/dhcpd-syntax )"
-
-S="${WORKDIR}/${MY_P}"
-
-src_unpack() {
-	unpack ${A}
-	# handle local bind hell
-	cd "${S}"/bind
-	unpack ./bind.tar.gz
-}
-
-PATCHES=(
-	# Gentoo patches - these will probably never be accepted upstream
-	# Fix some permission issues
-	"${FILESDIR}/${PN}-4.4.3-fix-perms.patch"
-
-	# Enable dhclient to equery NTP servers
-	"${FILESDIR}/${PN}-4.4.3-dhclient-ntp.patch"
-	"${FILESDIR}/${PN}-4.4.3-dhclient-resolvconf.patch"
-
-	# Enable dhclient to get extra configuration from stdin
-	"${FILESDIR}/${PN}-4.4.3-dhclient-stdin-conf.patch"
-	# bug #265531
-	"${FILESDIR}/${PN}-4.4.3-nogateway.patch"
-	# bug #296921
-	"${FILESDIR}/${PN}-4.4.3-quieter-ping.patch"
-	# bug #437108
-	"${FILESDIR}/${PN}-4.4.3-always-accept-4.patch"
-	# bug #480636
-	"${FILESDIR}/${PN}-4.4.3-iproute2-path.patch"
-	# bug #471142
-	"${FILESDIR}/${PN}-4.4.3-bindtodevice-inet6.patch"
-	# bug #559832
-	"${FILESDIR}/${PN}-4.4.3-ldap-ipv6-client-id.patch"
-
-	# Possible upstream candidates
-)
-
-src_prepare() {
-	default
-
-	# Brand the version with Gentoo
-	sed -i \
-		-e "/VERSION=/s:'$: Gentoo-${PR}':" \
-		configure || die
-
-	# Change the hook script locations of the scripts
-	sed -i \
-		-e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
-		-e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
-		client/scripts/* || die
-
-	# No need for the linux script to force bash #158540
-	sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
-
-	# Quiet the freebsd logger a little
-	sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
-
-	# Remove these options from the sample config
-	sed -i -r \
-		-e "/(script|host-name|domain-name) /d" \
-		client/dhclient.conf.example || die
-
-	if use client && ! use server ; then
-		sed -i -r \
-			-e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
-			Makefile.in || die
-	elif ! use client && use server ; then
-		sed -i -r \
-			-e '/^SUBDIRS/s:\<client\>::' \
-			Makefile.in || die
-	fi
-
-	# Only install different man pages if we don't have en
-	if [[ " ${LINGUAS} " != *" en "* ]]; then
-		# Install Japanese man pages
-		if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
-			einfo "Installing Japanese documention"
-			cp doc/ja_JP.eucJP/dhclient* client || die
-			cp doc/ja_JP.eucJP/dhcp* common || die
-		fi
-	fi
-	# Now remove the non-english docs so there are no errors later
-	rm -r doc/ja_JP.eucJP || die
-
-	# make the bind build work - do NOT make "binddir" local!
-	binddir="${S}/bind"
-	cd "${binddir}" || die
-	cat <<-EOF > bindvar.tmp
-	binddir=${binddir}
-	GMAKE=${MAKE:-gmake}
-	EOF
-	eapply -p2 "${FILESDIR}"/${PN}-4.4.3-bind-disable.patch
-	# Only use the relevant subdirs now that ISC
-	#removed the lib/export structure in bind.
-	sed '/^SUBDIRS/s@=.*$@= isc dns isccfg irs samples@' \
-		-i bind-*/lib/Makefile.in || die
-}
-
-src_configure() {
-	# bind defaults to stupid `/usr/bin/ar`
-	tc-export AR BUILD_CC
-	export ac_cv_path_AR=${AR}
-
-	# this is tested for by the bind build system, and can cause trouble
-	# when cross-building; since dhcp itself doesn't make use of libcap,
-	# simply disable it.
-	export ac_cv_lib_cap_cap_set_proc=no
-
-	# Use FHS sane paths ... some of these have configure options,
-	# but not all, so just do it all here.
-	local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
-	cat <<-EOF >> includes/site.h
-	#define _PATH_DHCPD_CONF     "${e}/dhcpd.conf"
-	#define _PATH_DHCLIENT_CONF  "${e}/dhclient.conf"
-	#define _PATH_DHCPD_DB       "${l}/dhcpd.leases"
-	#define _PATH_DHCPD6_DB      "${l}/dhcpd6.leases"
-	#define _PATH_DHCLIENT_DB    "${l}/dhclient.leases"
-	#define _PATH_DHCLIENT6_DB   "${l}/dhclient6.leases"
-	#define _PATH_DHCPD_PID      "${r}/dhcpd.pid"
-	#define _PATH_DHCPD6_PID     "${r}/dhcpd6.pid"
-	#define _PATH_DHCLIENT_PID   "${r}/dhcpclient.pid"
-	#define _PATH_DHCLIENT6_PID  "${r}/dhcpclient6.pid"
-	#define _PATH_DHCRELAY_PID   "${r}/dhcrelay.pid"
-	#define _PATH_DHCRELAY6_PID  "${r}/dhcrelay6.pid"
-	EOF
-
-	# Breaks with -O3 because of reliance on undefined behaviour
-	# bug #787935
-	append-flags -fno-strict-aliasing
-
-	# bug #720806, bug #801592
-	if use ppc || use arm || use hppa || [[ ${CHOST} == i486* ]] ; then
-		append-libs -latomic
-	fi
-
-	local myeconfargs=(
-		--enable-paranoia
-		--enable-early-chroot
-		--sysconfdir=${e}
-		--with-randomdev=/dev/random
-		$(use_enable ipv6 dhcpv6)
-		$(use_with ldap)
-		$(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
-		LIBS="${LIBS}"
-	)
-	econf "${myeconfargs[@]}"
-
-	# configure local bind cruft.  symtable option requires
-	# perl and we don't want to require that. bug #383837.
-	cd bind/bind-*/ || die
-	local el
-	eval econf \
-		$(for el in $(awk '/^bindconfig/,/^$/ {print}' ../Makefile.in) ; do if [[ ${el} =~ ^-- ]] ; then printf ' %s' ${el//\\} ; fi ; done | sed 's,@\([[:alpha:]]\+\)dir@,${binddir}/\1,g') \
-		--with-randomdev=/dev/random \
-		--disable-symtable \
-		--without-make-clean
-}
-
-src_compile() {
-	# Build local bind cruft first
-	emake -C bind/bind-*/lib install
-	# then build standard dhcp code
-	emake AR="$(tc-getAR)"
-}
-
-src_install() {
-	default
-
-	dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
-	docinto html
-	dodoc doc/References.html
-	newtmpfiles "${FILESDIR}"/dhcp.tmpfiles dhcp.conf
-
-	if [[ -e client/dhclient ]] ; then
-		# Move the client to /
-		dodir /sbin
-		mv "${ED}"/usr/sbin/dhclient "${ED}"/sbin/ || die
-
-		exeinto /sbin
-		if use kernel_linux ; then
-			newexe "${S}"/client/scripts/linux dhclient-script
-		else
-			newexe "${S}"/client/scripts/freebsd dhclient-script
-		fi
-	fi
-
-	if [[ -e server/dhcpd ]] ; then
-		if use ldap ; then
-			insinto /etc/openldap/schema
-			doins contrib/ldap/dhcp.*
-			dosbin contrib/ldap/dhcpd-conf-to-ldap
-		fi
-
-		newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
-		newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
-		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
-		newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
-		newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
-		newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
-
-		systemd_dounit "${FILESDIR}"/dhcpd4.service
-		systemd_dounit "${FILESDIR}"/dhcpd6.service
-		systemd_dounit "${FILESDIR}"/dhcrelay4.service
-		systemd_dounit "${FILESDIR}"/dhcrelay6.service
-		systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
-		systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
-
-		sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
-	fi
-
-	# the default config files aren't terribly useful #384087
-	local f
-	for f in "${ED}"/etc/dhcp/*.conf.example ; do
-		mv "${f}" "${f%.example}" || die
-	done
-	sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
-}
-
-pkg_preinst() {
-	# Keep the user files over the sample ones.  The
-	# hashing is to ignore the crappy defaults #384087.
-	local f h
-	for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
-		h=${f#*:}
-		f="/etc/dhcp/${f%:*}.conf"
-		if [ -e "${EROOT}"${f} ] ; then
-			case $(md5sum "${EROOT}"${f}) in
-				${h}*) ;;
-				*) cp -p "${EROOT}"${f} "${ED}"${f};;
-			esac
-		fi
-	done
-}
-
-pkg_postinst() {
-	tmpfiles_process dhcp.conf
-
-	if use client ; then
-		ewarn "The client and relay functionality will be removed in the next release!"
-		ewarn "Upstream have decided to discontinue this functionality."
-	fi
-
-	if [[ -e "${EROOT}"/etc/init.d/dhcp ]] ; then
-		ewarn
-		ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
-		ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
-		ewarn "and dhcp should be removed from the default runlevel"
-		ewarn
-	fi
-}

diff --git a/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild b/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild
index aca3e20ed93e..9fa84b982375 100644
--- a/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild
+++ b/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
 
 LICENSE="MPL-2.0 BSD SSLeay GPL-2" # GPL-2 only for init script
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
 IUSE="+client ipv6 ldap selinux +server ssl vim-syntax"
 
 BDEPEND="
@@ -76,7 +76,6 @@ PATCHES=(
 	"${FILESDIR}/${PN}-4.4.3-ldap-ipv6-client-id.patch"
 
 	# Possible upstream candidates
-	"${FILESDIR}/${PN}-4.4.3-configure-clang16.patch"
 )
 
 src_prepare() {

diff --git a/net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild b/net-misc/dhcp/dhcp-4.4.3_p1-r3.ebuild
similarity index 100%
copy from net-misc/dhcp/dhcp-4.4.3_p1-r2.ebuild
copy to net-misc/dhcp/dhcp-4.4.3_p1-r3.ebuild

diff --git a/net-misc/dhcp/files/dhcpd.init5 b/net-misc/dhcp/files/dhcpd.init5
index f0ea9b0c7904..66b29cd3bb00 100644
--- a/net-misc/dhcp/files/dhcpd.init5
+++ b/net-misc/dhcp/files/dhcpd.init5
@@ -77,11 +77,9 @@ start() {
 	local leasefile="$(get_var lease-file-name /var/lib/dhcp/${SVCNAME}.leases)"
 	checkpath -f -o dhcp:dhcp "${chroot}${leasefile}"
 
-	# Setup LD_PRELOAD so name resolution works in our chroot.
 	if [ -n "${chroot}" ] ; then
 		checkpath -d -o root:root -m 755 "${chroot}"/dev "${chroot}"/etc "${chroot}"/proc
 		cp -pP /etc/localtime /etc/resolv.conf "${chroot}"/etc/
-		export LD_PRELOAD="${LD_PRELOAD} libresolv.so libnss_dns.so"
 		if ! mountinfo -q "${chroot}/proc" ; then
 			mount --bind /proc "${chroot}/proc"
 		fi


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/
@ 2024-02-18 11:29 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2024-02-18 11:29 UTC (permalink / raw
  To: gentoo-commits

commit:     becd6aebc7e4c3e78e2497c4315ad2a1df5b3bd1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 18 11:23:52 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 18 11:24:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=becd6aeb

net-misc/dhcp: move patches to devspace for 4.4.3_p1-r5

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/dhcp/Manifest                          |   1 +
 net-misc/dhcp/dhcp-4.4.3_p1-r5.ebuild           |  27 +-
 net-misc/dhcp/files/dhcp-4.4.3-infiniband.patch | 957 ------------------------
 3 files changed, 16 insertions(+), 969 deletions(-)

diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
index 565f763ef590..47b71db74f8f 100644
--- a/net-misc/dhcp/Manifest
+++ b/net-misc/dhcp/Manifest
@@ -1 +1,2 @@
 DIST dhcp-4.4.3-P1.tar.gz 10081055 BLAKE2B 6cc16f7472efb1e1f6b7a83cafd9a81a16f10af7361da079c48a5eff0d9e310f475dcc82e984c20936c64867183402d00d26e5366e75bf7463ec2aea4a6f68a4 SHA512 d14dc44d1c015780ae19769816cb01015959927a1ad7a3e84b89e0463253aaf46451af88e3260347196373906d5b438c7c616fee45ec3f128aa82af6702b7154
+DIST dhcp-4.4.3-patches.tar.xz 15276 BLAKE2B 4750833f986eccdc60b63de55f0b0633039806d75e1bbb79ea6974990399f2ec33836fd22ec3a0981aaeffc3fcfd914deff96d139f4ea3c2ad1b9010ec737d06 SHA512 c8071f48e4074a7a83e74706868a782c7dc4bcb6df4b9035411e419a95bf90de66ece2b2aacc8f8f3ca517287599cb178704402ff276a4620c941733ce03c57b

diff --git a/net-misc/dhcp/dhcp-4.4.3_p1-r5.ebuild b/net-misc/dhcp/dhcp-4.4.3_p1-r5.ebuild
index 479016e40c64..040aa5192a15 100644
--- a/net-misc/dhcp/dhcp-4.4.3_p1-r5.ebuild
+++ b/net-misc/dhcp/dhcp-4.4.3_p1-r5.ebuild
@@ -16,6 +16,7 @@ HOMEPAGE="https://www.isc.org/dhcp"
 SRC_URI="
 	https://downloads.isc.org/isc/dhcp/${MY_P}.tar.gz
 	https://downloads.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz
+	https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/dhcp-4.4.3-patches.tar.xz
 "
 S="${WORKDIR}/${MY_P}"
 
@@ -50,29 +51,31 @@ BDEPEND="
 PATCHES=(
 	# Gentoo patches - these will probably never be accepted upstream
 	# Fix some permission issues
-	"${FILESDIR}/${PN}-4.4.3-fix-perms.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-fix-perms.patch"
 
 	# Enable dhclient to equery NTP servers
-	"${FILESDIR}/${PN}-4.4.3-dhclient-ntp.patch"
-	"${FILESDIR}/${PN}-4.4.3-dhclient-resolvconf.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-dhclient-ntp.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-dhclient-resolvconf.patch"
 
 	# Enable dhclient to get extra configuration from stdin
-	"${FILESDIR}/${PN}-4.4.3-dhclient-stdin-conf.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-dhclient-stdin-conf.patch"
 	# bug #265531
-	"${FILESDIR}/${PN}-4.4.3-nogateway.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-nogateway.patch"
 	# bug #296921
-	"${FILESDIR}/${PN}-4.4.3-quieter-ping.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-quieter-ping.patch"
 	# bug #437108
-	"${FILESDIR}/${PN}-4.4.3-always-accept-4.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-always-accept-4.patch"
 	# bug #480636
-	"${FILESDIR}/${PN}-4.4.3-iproute2-path.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-iproute2-path.patch"
 	# bug #471142
-	"${FILESDIR}/${PN}-4.4.3-bindtodevice-inet6.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-bindtodevice-inet6.patch"
 	# bug #559832
-	"${FILESDIR}/${PN}-4.4.3-ldap-ipv6-client-id.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-ldap-ipv6-client-id.patch"
+	# bug #908986
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-infiniband.patch"
 
 	# Possible upstream candidates
-	"${FILESDIR}/${PN}-4.4.3-configure-clang16.patch"
+	"${WORKDIR}/dhcp-4.4.3-patches/${PN}-4.4.3-configure-clang16.patch"
 )
 
 src_unpack() {
@@ -136,7 +139,7 @@ src_prepare() {
 	binddir=${binddir}
 	GMAKE=${MAKE:-gmake}
 	EOF
-	eapply -p2 "${FILESDIR}"/${PN}-4.4.3-bind-disable.patch
+	eapply -p2 "${WORKDIR}"/dhcp-4.4.3-patches/${PN}-4.4.3-bind-disable.patch
 	# Only use the relevant subdirs now that ISC
 	#removed the lib/export structure in bind.
 	sed '/^SUBDIRS/s@=.*$@= isc dns isccfg irs samples@' \

diff --git a/net-misc/dhcp/files/dhcp-4.4.3-infiniband.patch b/net-misc/dhcp/files/dhcp-4.4.3-infiniband.patch
deleted file mode 100644
index 6c1489e2a788..000000000000
--- a/net-misc/dhcp/files/dhcp-4.4.3-infiniband.patch
+++ /dev/null
@@ -1,957 +0,0 @@
-diff -urP a/client/clparse.c b/client/clparse.c
---- a/client/clparse.c	2023-06-21 23:44:22.471212250 -0600
-+++ b/client/clparse.c	2023-06-22 00:07:48.650031050 -0600
-@@ -197,6 +197,7 @@
- 	/* Requested lease time, used by DHCPv6 (DHCPv4 uses the option cache)
- 	 */
- 	top_level_config.requested_lease = 7200;
-+	top_level_config.bootp_broadcast_always = 0;
- 
- 	group_allocate (&top_level_config.on_receipt, MDL);
- 	if (!top_level_config.on_receipt)
-@@ -460,7 +461,8 @@
- 	interface-declaration |
- 	LEASE client-lease-statement |
- 	ALIAS client-lease-statement |
--	KEY key-definition */
-+	KEY key-definition |
-+	BOOTP_BROADCAST_ALWAYS */
- 
- void parse_client_statement (cfile, ip, config)
- 	struct parse *cfile;
-@@ -884,6 +886,12 @@
- 		break;
- 
- 
-+	      case BOOTP_BROADCAST_ALWAYS:
-+		token = next_token(&val, (unsigned*)0, cfile);
-+		config -> bootp_broadcast_always = 1;
-+		parse_semi (cfile);
-+		return;
-+
- 	      default:
- 		lose = 0;
- 		stmt = (struct executable_statement *)0;
-diff -urP a/client/dhclient.c b/client/dhclient.c
---- a/client/dhclient.c	2023-06-21 23:44:22.488212252 -0600
-+++ b/client/dhclient.c	2023-06-22 00:07:48.650031050 -0600
-@@ -53,6 +53,13 @@
- 
- static void add_to_tail(struct client_lease** lease_list, struct client_lease* lease);
- 
-+/* Default Prefix */
-+static unsigned char default_prefix[12] = {
-+	0xff, 0x00, 0x00, 0x00,
-+	0x00, 0x00, 0x02, 0x00,
-+	0x00, 0x02, 0xc9, 0x00
-+};
-+
- /* False (default) => we write and use a pid file */
- isc_boolean_t no_pid_file = ISC_FALSE;
- 
-@@ -76,6 +83,8 @@
-    assert (state_is == state_shouldbe). */
- #define ASSERT_STATE(state_is, state_shouldbe) {}
- 
-+static void setup_ib_interface(struct interface_info *ip);
-+
- #ifndef UNIT_TEST
- static const char copyright[] = "Copyright 2004-2022 Internet Systems Consortium.";
- static const char arr [] = "All rights reserved.";
-@@ -821,6 +830,26 @@
- 		}
- 	}
- 
-+	/* We create a backup seed before rediscovering interfaces in order to
-+	   have a seed built using all of the available interfaces
-+	   It's interesting if required interfaces doesn't let us defined
-+	   a really unique seed due to a lack of valid HW addr later
-+	   (this is the case with DHCP over IB)
-+	   We only use the last device as using a sum could broke the
-+	   uniqueness of the seed among multiple nodes
-+	 */
-+	unsigned backup_seed = 0;
-+	for (ip = interfaces; ip; ip = ip -> next) {
-+		int junk;
-+		if ( ip -> hw_address.hlen <= sizeof seed )
-+		  continue;
-+		memcpy (&junk,
-+			&ip -> hw_address.hbuf [ip -> hw_address.hlen -
-+						sizeof seed], sizeof seed);
-+		backup_seed = junk;
-+	}
-+
-+
- 	/* At this point, all the interfaces that the script thinks
- 	   are relevant should be running, so now we once again call
- 	   discover_interfaces(), and this time ask it to actually set
-@@ -832,6 +861,7 @@
- 	/* PLEASE PREFER the random device: not all systems use random
- 	 * process identifiers so the alternative can be predictable. */
- 	seed = 0;
-+	int seed_flag = 0;
- 	size_t nrnd = 0;
- #ifdef ISC_PATH_RANDOMDEV
- 	FILE *frnd = fopen(ISC_PATH_RANDOMDEV, "r");
-@@ -851,15 +881,42 @@
- 
- 		for (ip = interfaces; ip; ip = ip->next) {
- 			int junk;
-+			if ( ip -> hw_address.hlen <= sizeof seed )
-+				continue;
- 			memcpy(&junk,
- 			       &ip->hw_address.hbuf[ip->hw_address.hlen -
- 						    sizeof seed], sizeof seed);
- 			seed += junk;
-+			seed_flag = 1;
- 		}
- 		seed += cur_time + (unsigned)getpid();
- 	}
-+	if ( seed_flag == 0 ) {
-+		if ( backup_seed != 0 ) {
-+			seed = backup_seed;
-+			log_info ("xid: rand init seed (0x%x) built using all"
-+			          " available interfaces",seed);
-+		}
-+		else {
-+			seed = cur_time^((unsigned) gethostid()) ;
-+			log_info ("xid: warning: no netdev with useable HWADDR"
-+			          " found for seed's uniqueness enforcement");
-+			log_info ("xid: rand init seed (0x%x) built using"
-+			          " gethostid", seed);
-+		}
-+		/* we only use seed and no current time as a broadcast reply */
-+		/* will certainly be used by the hwaddrless interface */
-+	}
- 	srandom(seed);
- 
-+	/* Setup specific Infiniband options */
-+	for (ip = interfaces; ip; ip = ip->next) {
-+		if (ip->client &&
-+		    (ip->hw_address.hbuf[0] == HTYPE_INFINIBAND)) {
-+			setup_ib_interface(ip);
-+		}
-+	}
-+
- 	/*
- 	 * Establish a default DUID.  We always do so for v6 and
- 	 * do so if desired for v4 via the -D or -i options
-@@ -1154,6 +1211,66 @@
- 	return 0;
- }
- 
-+static void setup_ib_interface(struct interface_info *ip)
-+{
-+	struct group *g;
-+	struct hardware *hw = &ip->hw_address;
-+	char client_id[64];
-+	char *arg_conf = NULL;
-+	int arg_conf_len = 0;
-+	isc_result_t status;
-+	struct parse *cfile = (struct parse *)0;
-+
-+	/* Set the broadcast flag */
-+	ip->client->config->bootp_broadcast_always = 1;
-+
-+	/*
-+	 * Find out if a dhcp-client-identifier option was specified either
-+	 * in the config file or on the command line
-+	 */
-+	for (g = ip->client->config->on_transmission; g != NULL; g = g->next) {
-+		if ((g->statements != NULL) &&
-+		    (strcmp(g->statements->data.option->option->name,
-+		            "dhcp-client-identifier") == 0)) {
-+			return;
-+		}
-+	}
-+
-+	/*
-+	 * No client ID specified, make up one based on a default
-+	 * "prefix" and the port GUID.
-+	 *
-+	 * NOTE: This is compatible with what gpxe does.
-+	 */
-+	sprintf(client_id, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
-+		default_prefix[0], default_prefix[1], default_prefix[2],
-+		default_prefix[3], default_prefix[4], default_prefix[5],
-+		default_prefix[6], default_prefix[7], default_prefix[8],
-+		default_prefix[9], default_prefix[10], default_prefix[11],
-+		hw->hbuf[1], hw->hbuf[2], hw->hbuf[3], hw->hbuf[4],
-+		hw->hbuf[5], hw->hbuf[6], hw->hbuf[7], hw->hbuf[8]);
-+
-+	arg_conf_len = asprintf(&arg_conf,
-+				"send dhcp-client-identifier %s;",
-+				client_id);
-+
-+	if ((arg_conf == 0) || (arg_conf_len <= 0))
-+		log_fatal("Unable to send option dhcp-client-identifier");
-+
-+	status = new_parse(&cfile, -1, arg_conf, arg_conf_len,
-+			   "Automatic Infiniband client identifier", 0);
-+
-+	if ((status != ISC_R_SUCCESS) || (cfile->warnings_occurred))
-+		log_fatal("Failed to parse Infiniband client identifier");
-+
-+	parse_client_statement(cfile, NULL, ip->client->config);
-+
-+	if (cfile->warnings_occurred)
-+		log_fatal("Failed to parse Infiniband client identifier");
-+
-+	end_parse(&cfile);
-+}
-+
- /* Individual States:
-  *
-  * Each routine is called from the dhclient_state_machine() in one of
-@@ -1367,7 +1484,6 @@
- 	struct client_state *client = cpp;
- 	struct client_lease *lp, *next, *picked;
- 
--
- 	ASSERT_STATE(state, S_SELECTING);
- 
- 	/*
-@@ -1483,9 +1599,10 @@
- 		return;
- 	}
- 
--	log_info ("DHCPACK of %s from %s",
-+	log_info ("DHCPACK of %s from %s (xid=0x%x)",
- 		  inet_ntoa(packet->raw->yiaddr),
--		  piaddr (packet->client_addr));
-+		  piaddr (packet->client_addr),
-+		  ntohl(client -> xid));
- 
- 	/* Check v6only first. */
- 	v6only_wait = check_v6only(packet, client);
-@@ -2439,7 +2556,7 @@
- 		return;
- 	}
- 
--	log_info ("DHCPNAK from %s", piaddr (packet -> client_addr));
-+	log_info ("DHCPNAK from %s (xid=0x%x)", piaddr (packet -> client_addr), ntohl(client -> xid));
- 
- 	if (!client -> active) {
- #if defined (DEBUG)
-@@ -2572,10 +2689,11 @@
- 			  (long)(client -> interval));
- 	} else
- #endif
--	log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
-+	log_info ("DHCPDISCOVER on %s to %s port %d interval %ld (xid=0x%x)",
- 	      client -> name ? client -> name : client -> interface -> name,
- 	      inet_ntoa (sockaddr_broadcast.sin_addr),
--	      ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval));
-+	      ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval),
-+	      ntohl(client -> xid));
- 
- 	/* Send out a packet. */
- #if defined(DHCPv6) && defined(DHCP4o6)
-@@ -2969,10 +3087,10 @@
- 	}
- 
- 	strncpy(rip_buf, rip_str, sizeof(rip_buf)-1);
--	log_info ("DHCPREQUEST for %s on %s to %s port %d", rip_buf,
-+	log_info ("DHCPREQUEST for %s on %s to %s port %d (xid=0x%x)", rip_buf,
- 		  client->name ? client->name : client->interface->name,
- 		  inet_ntoa(destination.sin_addr),
--		  ntohs (destination.sin_port));
-+		  ntohs (destination.sin_port), client -> xid);
- 
- #if defined(DHCPv6) && defined(DHCP4o6)
- 	if (dhcpv4_over_dhcpv6) {
-@@ -3029,11 +3147,11 @@
- 		log_info ("DHCPDECLINE");
- 	} else
- #endif
--	log_info ("DHCPDECLINE of %s on %s to %s port %d",
-+	log_info ("DHCPDECLINE of %s on %s to %s port %d (xid=0x%x)",
- 		  piaddr(client->requested_address),
- 		  (client->name ? client->name : client->interface->name),
- 		  inet_ntoa(sockaddr_broadcast.sin_addr),
--		  ntohs(sockaddr_broadcast.sin_port));
-+		  ntohs(sockaddr_broadcast.sin_port), client -> xid);
- 
- 	/* Send out a packet. */
- #if defined(DHCPv6) && defined(DHCP4o6)
-@@ -3092,11 +3210,11 @@
- 		log_info ("DHCPRELEASE");
- 	} else
- #endif
--	log_info ("DHCPRELEASE of %s on %s to %s port %d",
-+	log_info ("DHCPRELEASE of %s on %s to %s port %d (xid=0x%x)",
- 		  piaddr(client->active->address),
- 		  client->name ? client->name : client->interface->name,
- 		  inet_ntoa (destination.sin_addr),
--		  ntohs (destination.sin_port));
-+		  ntohs (destination.sin_port), client -> xid);
- 
- #if defined(DHCPv6) && defined(DHCP4o6)
- 	if (dhcpv4_over_dhcpv6) {
-@@ -3472,7 +3590,8 @@
- 	client -> packet.xid = random ();
- 	client -> packet.secs = 0; /* filled in by send_discover. */
- 
--	if (can_receive_unicast_unconfigured (client -> interface))
-+	if ((!(client->config->bootp_broadcast_always))
-+	    && can_receive_unicast_unconfigured(client->interface))
- 		client -> packet.flags = 0;
- 	else
- 		client -> packet.flags = htons (BOOTP_BROADCAST);
-@@ -3557,7 +3676,8 @@
- 	} else {
- 		memset (&client -> packet.ciaddr, 0,
- 			sizeof client -> packet.ciaddr);
--		if (can_receive_unicast_unconfigured (client -> interface))
-+		if ((!(client ->config->bootp_broadcast_always)) &&
-+		    can_receive_unicast_unconfigured (client -> interface))
- 			client -> packet.flags = 0;
- 		else
- 			client -> packet.flags = htons (BOOTP_BROADCAST);
-@@ -3620,7 +3740,8 @@
- 	client -> packet.hops = 0;
- 	client -> packet.xid = client -> xid;
- 	client -> packet.secs = 0; /* Filled in by send_request. */
--	if (can_receive_unicast_unconfigured (client -> interface))
-+	if ((!(client->config-> bootp_broadcast_always))
-+	    && can_receive_unicast_unconfigured (client->interface))
- 		client -> packet.flags = 0;
- 	else
- 		client -> packet.flags = htons (BOOTP_BROADCAST);
-diff -urP a/common/bpf.c b/common/bpf.c
---- a/common/bpf.c	2022-09-28 08:39:15.000000000 -0600
-+++ b/common/bpf.c	2023-06-22 00:06:39.769025295 -0600
-@@ -116,7 +116,7 @@
- 		log_fatal ("Can't attach interface %s to bpf device %s: %m",
- 		       info -> name, filename);
- 
--	get_hw_addr(info->name, &info->hw_address);
-+	get_hw_addr(info);
- 
- 	return sock;
- }
-@@ -237,11 +237,44 @@
- 	sizeof dhcp_bpf_relay_filter / sizeof (struct bpf_insn);
- #endif
- 
-+/* Packet filter program for DHCP over Infiniband.
-+ *
-+ * XXX
-+ * Changes to the filter program may require changes to the constant offsets
-+ * used in lpf_gen_filter_setup to patch the port in the BPF program!
-+ * XXX
-+ */
-+struct bpf_insn dhcp_ib_bpf_filter [] = {
-+	/* Packet filter for Infiniband */
-+	/* Make sure it's a UDP packet... */
-+	BPF_STMT(BPF_LD + BPF_B + BPF_ABS, 9),
-+	BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 0, 6),
-+
-+	/* Make sure this isn't a fragment... */
-+	BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 6),
-+	BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 4, 0),
-+
-+	/* Get the IP header length... */
-+	BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 0),
-+
-+	/* Make sure it's to the right port... */
-+	BPF_STMT(BPF_LD + BPF_H + BPF_IND, 2),
-+	BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1),
-+
-+	/* If we passed all the tests, ask for the whole packet. */
-+	BPF_STMT(BPF_RET + BPF_K, (u_int)-1),
-+
-+	/* Otherwise, drop it. */
-+	BPF_STMT(BPF_RET + BPF_K, 0),
-+};
-+
- #if defined (DEC_FDDI)
- struct bpf_insn *bpf_fddi_filter = NULL;
- #endif
- 
- int dhcp_bpf_filter_len = sizeof dhcp_bpf_filter / sizeof (struct bpf_insn);
-+int dhcp_ib_bpf_filter_len = sizeof dhcp_ib_bpf_filter / sizeof (struct bpf_insn);
-+
- #if defined (HAVE_TR_SUPPORT)
- struct bpf_insn dhcp_bpf_tr_filter [] = {
-         /* accept all token ring packets due to variable length header */
-@@ -600,7 +633,9 @@
- 
- #if defined(USE_BPF_RECEIVE) || defined(USE_BPF_HWADDR)
- void
--get_hw_addr(const char *name, struct hardware *hw) {
-+get_hw_addr(struct interface_info *info) {
-+	struct hardware *hw = &info->hw_address;
-+	const char *name = info->name;
- 	struct ifaddrs *ifa;
- 	struct ifaddrs *p;
- 	struct sockaddr_dl *sa;
-diff -urP a/common/conflex.c b/common/conflex.c
---- a/common/conflex.c	2022-09-28 08:39:15.000000000 -0600
-+++ b/common/conflex.c	2023-06-22 00:07:48.650031050 -0600
-@@ -832,6 +832,8 @@
- 		if (!strcasecmp(atom+1, "ig-endian")) {
- 			return TOKEN_BIG_ENDIAN;
- 		}
-+		if (!strcasecmp (atom + 1, "ootp-broadcast-always"))
-+			return BOOTP_BROADCAST_ALWAYS;
- 		break;
- 	      case 'c':
- 		if (!strcasecmp(atom + 1, "ase"))
-diff -urP a/common/discover.c b/common/discover.c
---- a/common/discover.c	2022-09-28 08:39:15.000000000 -0600
-+++ b/common/discover.c	2023-06-22 00:06:39.770025295 -0600
-@@ -899,7 +899,7 @@
- 				if_register_send(tmp);
- 			} else {
- 				/* get_hw_addr() was called by register. */
--				get_hw_addr(tmp->name, &tmp->hw_address);
-+				get_hw_addr(tmp);
- 			}
- 			break;
- #ifdef DHCPv6
-@@ -912,7 +912,7 @@
- 				   so now we have to call it explicitly
- 				   to not leave the hardware address unknown
- 				   (some code expects it cannot be. */
--				get_hw_addr(tmp->name, &tmp->hw_address);
-+				get_hw_addr(tmp);
- 			} else {
- 				if_register_linklocal6(tmp);
- 			}
-diff -urP a/common/dlpi.c b/common/dlpi.c
---- a/common/dlpi.c	2022-09-28 08:39:15.000000000 -0600
-+++ b/common/dlpi.c	2023-06-22 00:06:39.770025295 -0600
-@@ -1343,7 +1343,9 @@
- #endif /* USE_DLPI_SEND */
- 
- void
--get_hw_addr(const char *name, struct hardware *hw) {
-+get_hw_addr(struct interface_info *info) {
-+	struct hardware *hw = &info->hw_address;
-+	const char *name = info->name;
- 	int sock, unit;
- 	long buf[DLPI_MAXDLBUF];
-         union DL_primitives *dlp;
-diff -urP a/common/lpf.c b/common/lpf.c
---- a/common/lpf.c	2022-09-28 08:39:15.000000000 -0600
-+++ b/common/lpf.c	2023-06-22 00:06:39.769025295 -0600
-@@ -45,6 +45,17 @@
- #include <sys/ioctl.h>
- #include <sys/socket.h>
- #include <net/if.h>
-+#include <ifaddrs.h>
-+
-+/* Default broadcast address for IPoIB */
-+static unsigned char default_ib_bcast_addr[20] = {
-+ 	0x00, 0xff, 0xff, 0xff,
-+	0xff, 0x12, 0x40, 0x1b,
-+	0x00, 0x00, 0x00, 0x00,
-+	0x00, 0x00, 0x00, 0x00,
-+	0xff, 0xff, 0xff, 0xff
-+};
-+
- #endif
- 
- #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
-@@ -78,10 +89,21 @@
- 		struct sockaddr common;
- 		} sa;
- 	struct ifreq ifr;
-+	int type;
-+	int protocol;
- 
- 	/* Make an LPF socket. */
--	if ((sock = socket(PF_PACKET, SOCK_RAW,
--			   htons((short)ETH_P_ALL))) < 0) {
-+	get_hw_addr(info);
-+
-+	if (info->hw_address.hbuf[0] == HTYPE_INFINIBAND) {
-+		type = SOCK_DGRAM;
-+		protocol = ETHERTYPE_IP;
-+	} else {
-+		type = SOCK_RAW;
-+		protocol = ETH_P_ALL;
-+	}
-+
-+	if ((sock = socket(PF_PACKET, type, htons((short)protocol))) < 0) {
- 		if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
- 		    errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
- 		    errno == EAFNOSUPPORT || errno == EINVAL) {
-@@ -104,6 +126,7 @@
- 	/* Bind to the interface name */
- 	memset (&sa, 0, sizeof sa);
- 	sa.ll.sll_family = AF_PACKET;
-+	sa.ll.sll_protocol = htons(protocol);
- 	sa.ll.sll_ifindex = ifr.ifr_ifindex;
- 	if (bind (sock, &sa.common, sizeof sa)) {
- 		if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
-@@ -120,8 +143,6 @@
- 
- 	}
- 
--	get_hw_addr(info->name, &info->hw_address);
--
- 	return sock;
- }
- #endif /* USE_LPF_SEND || USE_LPF_RECEIVE */
-@@ -176,6 +197,8 @@
-    in bpf includes... */
- extern struct sock_filter dhcp_bpf_filter [];
- extern int dhcp_bpf_filter_len;
-+extern struct sock_filter dhcp_ib_bpf_filter [];
-+extern int dhcp_ib_bpf_filter_len;
- 
- #if defined(RELAY_PORT)
- extern struct sock_filter dhcp_bpf_relay_filter [];
-@@ -197,16 +220,14 @@
- 	info -> rfdesc = if_register_lpf (info);
- 
- #ifdef PACKET_AUXDATA
--	{
--	int val = 1;
--
--	if (setsockopt(info->rfdesc, SOL_PACKET, PACKET_AUXDATA,
--		       &val, sizeof(val)) < 0) {
--		if (errno != ENOPROTOOPT) {
--			log_fatal ("Failed to set auxiliary packet data: %m");
-+	if (info->hw_address.hbuf[0] != HTYPE_INFINIBAND) {
-+		int val = 1;
-+		if (setsockopt (info -> rfdesc, SOL_PACKET, PACKET_AUXDATA,
-+				&val, sizeof val) < 0) {
-+			if (errno != ENOPROTOOPT)
-+				log_fatal ("Failed to set auxiliary packet data: %m");
- 		}
- 	}
--	}
- #endif
- 
- 
-@@ -253,26 +274,40 @@
- 
- 	memset(&p, 0, sizeof(p));
- 
--	/* Set up the bpf filter program structure.    This is defined in
--	   bpf.c */
--	p.len = dhcp_bpf_filter_len;
--	p.filter = dhcp_bpf_filter;
--
--        /* Patch the server port into the LPF  program...
--	   XXX changes to filter program may require changes
--	   to the insn number(s) used below! XXX */
-+	if (info->hw_address.hbuf[0] == HTYPE_INFINIBAND) {
-+		/* Set up the bpf filter program structure. */
-+		p.len = dhcp_ib_bpf_filter_len;
-+		p.filter = dhcp_ib_bpf_filter;
-+
-+		/* Patch the server port into the LPF program...
-+		   XXX
-+		   changes to filter program may require changes
-+		   to the insn number(s) used below!
-+		   XXX */
-+		dhcp_ib_bpf_filter[6].k = ntohs ((short)local_port);
-+	} else {
-+		/* Set up the bpf filter program structure.
-+		   This is defined in bpf.c */
-+		p.len = dhcp_bpf_filter_len;
-+		p.filter = dhcp_bpf_filter;
-+
-+		/* Patch the server port into the LPF  program...
-+		   XXX changes to filter program may require changes
-+		   to the insn number(s) used below! XXX */
- #if defined(RELAY_PORT)
--	if (relay_port) {
--		/*
--		 * If user defined relay UDP port, we need to filter
--		 * also on the user UDP port.
--		 */
--		p.len = dhcp_bpf_relay_filter_len;
--		p.filter = dhcp_bpf_relay_filter;
-+		if (relay_port) {
-+			/*
-+			 * If user defined relay UDP port, we need to filter
-+			 * also on the user UDP port.
-+			 */
-+			p.len = dhcp_bpf_relay_filter_len;
-+			p.filter = dhcp_bpf_relay_filter;
- 
--		dhcp_bpf_relay_filter [10].k = ntohs (relay_port);
--	}
-+			dhcp_bpf_relay_filter [10].k = ntohs (relay_port);
-+		}
- #endif
-+		dhcp_bpf_filter [8].k = ntohs ((short)local_port);
-+	}
- 	dhcp_bpf_filter [8].k = ntohs (local_port);
- 
- 	if (setsockopt (info -> rfdesc, SOL_SOCKET, SO_ATTACH_FILTER, &p,
-@@ -330,6 +365,54 @@
- #endif /* USE_LPF_RECEIVE */
- 
- #ifdef USE_LPF_SEND
-+ssize_t send_packet_ib(interface, packet, raw, len, from, to, hto)
-+	struct interface_info *interface;
-+	struct packet *packet;
-+	struct dhcp_packet *raw;
-+	size_t len;
-+	struct in_addr from;
-+	struct sockaddr_in *to;
-+	struct hardware *hto;
-+{
-+	unsigned ibufp = 0;
-+	double ih [1536 / sizeof (double)];
-+	unsigned char *buf = (unsigned char *)ih;
-+	ssize_t result;
-+
-+	union sockunion {
-+		struct sockaddr sa;
-+		struct sockaddr_ll sll;
-+		struct sockaddr_storage ss;
-+	} su;
-+
-+	assemble_udp_ip_header (interface, buf, &ibufp, from.s_addr,
-+				to->sin_addr.s_addr, to->sin_port,
-+				(unsigned char *)raw, len);
-+	memcpy (buf + ibufp, raw, len);
-+
-+	memset(&su, 0, sizeof(su));
-+	su.sll.sll_family = AF_PACKET;
-+	su.sll.sll_protocol = htons(ETHERTYPE_IP);
-+
-+	if (!(su.sll.sll_ifindex = if_nametoindex(interface->name))) {
-+		errno = ENOENT;
-+		log_error ("send_packet_ib: %m - failed to get if index");
-+		return -1;
-+	}
-+
-+	su.sll.sll_hatype = htons(HTYPE_INFINIBAND);
-+	su.sll.sll_halen = sizeof(interface->bcast_addr);
-+	memcpy(&su.sll.sll_addr, interface->bcast_addr, 20);
-+
-+	result = sendto(interface->wfdesc, buf, ibufp + len, 0,
-+			&su.sa, sizeof(su));
-+
-+	if (result < 0)
-+		log_error ("send_packet_ib: %m");
-+
-+	return result;
-+}
-+
- ssize_t send_packet (interface, packet, raw, len, from, to, hto)
- 	struct interface_info *interface;
- 	struct packet *packet;
-@@ -350,6 +433,11 @@
- 		return send_fallback (interface, packet, raw,
- 				      len, from, to, hto);
- 
-+	if (interface->hw_address.hbuf[0] == HTYPE_INFINIBAND) {
-+		return send_packet_ib(interface, packet, raw, len, from,
-+				      to, hto);
-+	}
-+
- 	if (hto == NULL && interface->anycast_mac_addr.hlen)
- 		hto = &interface->anycast_mac_addr;
- 
-@@ -370,6 +458,42 @@
- #endif /* USE_LPF_SEND */
- 
- #ifdef USE_LPF_RECEIVE
-+ssize_t receive_packet_ib (interface, buf, len, from, hfrom)
-+	struct interface_info *interface;
-+	unsigned char *buf;
-+	size_t len;
-+	struct sockaddr_in *from;
-+	struct hardware *hfrom;
-+{
-+	int length = 0;
-+	int offset = 0;
-+	unsigned char ibuf [1536];
-+	unsigned bufix = 0;
-+	unsigned paylen;
-+
-+	length = read(interface->rfdesc, ibuf, sizeof(ibuf));
-+
-+	if (length <= 0)
-+		return length;
-+
-+	offset = decode_udp_ip_header(interface, ibuf, bufix, from,
-+				       (unsigned)length, &paylen, 0);
-+
-+	if (offset < 0)
-+		return 0;
-+
-+	bufix += offset;
-+	length -= offset;
-+
-+	if (length < paylen)
-+		log_fatal("Internal inconsistency at %s:%d.", MDL);
-+
-+	/* Copy out the data in the packet... */
-+	memcpy(buf, &ibuf[bufix], paylen);
-+
-+	return (ssize_t)paylen;
-+}
-+
- ssize_t receive_packet (interface, buf, len, from, hfrom)
- 	struct interface_info *interface;
- 	unsigned char *buf;
-@@ -408,6 +532,10 @@
- 	};
- #endif /* PACKET_AUXDATA */
- 
-+	if (interface->hw_address.hbuf[0] == HTYPE_INFINIBAND) {
-+		return receive_packet_ib(interface, buf, len, from, hfrom);
-+	}
-+
- 	length = recvmsg (interface->rfdesc, &msg, 0);
- 	if (length <= 0)
- 		return length;
-@@ -521,11 +649,33 @@
- #endif
- 
- #if defined (USE_LPF_RECEIVE) || defined (USE_LPF_HWADDR)
--void
--get_hw_addr(const char *name, struct hardware *hw) {
-+struct sockaddr_ll *
-+get_ll (struct ifaddrs *ifaddrs, struct ifaddrs **ifa, char *name)
-+{
-+	for (*ifa = ifaddrs; *ifa != NULL; *ifa = (*ifa)->ifa_next) {
-+		if ((*ifa)->ifa_addr == NULL)
-+			continue;
-+
-+		if ((*ifa)->ifa_addr->sa_family != AF_PACKET)
-+			continue;
-+
-+		if ((*ifa)->ifa_flags & IFF_LOOPBACK)
-+			continue;
-+
-+		if (strcmp((*ifa)->ifa_name, name) == 0)
-+			return (struct sockaddr_ll *)(void *)(*ifa)->ifa_addr;
-+	}
-+	*ifa = NULL;
-+	return NULL;
-+}
-+
-+struct sockaddr_ll *
-+ioctl_get_ll(char *name)
-+{
- 	int sock;
- 	struct ifreq tmp;
--	struct sockaddr *sa;
-+	struct sockaddr *sa = NULL;
-+	struct sockaddr_ll *sll = NULL;
- 
- 	if (strlen(name) >= sizeof(tmp.ifr_name)) {
- 		log_fatal("Device name too long: \"%s\"", name);
-@@ -542,13 +692,59 @@
- 		log_fatal("Error getting hardware address for \"%s\": %m",
- 			  name);
- 	}
-+	close(sock);
- 
- 	sa = &tmp.ifr_hwaddr;
--	switch (sa->sa_family) {
-+	// needs to be freed outside this function
-+	sll = dmalloc (sizeof (struct sockaddr_ll), MDL);
-+	if (!sll)
-+		log_fatal("Unable to allocate memory for link layer address");
-+	memcpy(&sll->sll_hatype, &sa->sa_family, sizeof (sll->sll_hatype));
-+	memcpy(sll->sll_addr, sa->sa_data, sizeof (sll->sll_addr));
-+	switch (sll->sll_hatype) {
-+		case ARPHRD_INFINIBAND:
-+			/* ioctl limits hardware addresses to 8 bytes */
-+			sll->sll_halen = 8;
-+			break;
-+		default:
-+			break;
-+	}
-+	return sll;
-+}
-+
-+void
-+get_hw_addr(struct interface_info *info)
-+{
-+	struct hardware *hw = &info->hw_address;
-+	char *name = info->name;
-+	struct ifaddrs *ifaddrs = NULL;
-+	struct ifaddrs *ifa = NULL;
-+	struct sockaddr_ll *sll = NULL;
-+	int sll_allocated = 0;
-+	char *dup = NULL;
-+	char *colon = NULL;
-+
-+	if (getifaddrs(&ifaddrs) == -1)
-+		log_fatal("Failed to get interfaces");
-+
-+	if ((sll = get_ll(ifaddrs, &ifa, name)) == NULL) {
-+		/*
-+		 * We were unable to get link-layer address for name.
-+		 * Fall back to ioctl(SIOCGIFHWADDR).
-+		 */
-+		sll = ioctl_get_ll(name);
-+		if (sll != NULL)
-+			sll_allocated = 1;
-+		else
-+			// shouldn't happen
-+			log_fatal("Unexpected internal error");
-+	}
-+
-+	switch (sll->sll_hatype) {
- 		case ARPHRD_ETHER:
- 			hw->hlen = 7;
- 			hw->hbuf[0] = HTYPE_ETHER;
--			memcpy(&hw->hbuf[1], sa->sa_data, 6);
-+			memcpy(&hw->hbuf[1], sll->sll_addr, 6);
- 			break;
- 		case ARPHRD_IEEE802:
- #ifdef ARPHRD_IEEE802_TR
-@@ -556,18 +752,51 @@
- #endif /* ARPHRD_IEEE802_TR */
- 			hw->hlen = 7;
- 			hw->hbuf[0] = HTYPE_IEEE802;
--			memcpy(&hw->hbuf[1], sa->sa_data, 6);
-+			memcpy(&hw->hbuf[1], sll->sll_addr, 6);
- 			break;
- 		case ARPHRD_FDDI:
- 			hw->hlen = 7;
- 			hw->hbuf[0] = HTYPE_FDDI;
--			memcpy(&hw->hbuf[1], sa->sa_data, 6);
-+			memcpy(&hw->hbuf[1], sll->sll_addr, 6);
-+			break;
-+		case ARPHRD_INFINIBAND:
-+			dup = strdup(name);
-+			/* Aliased infiniband interface is special case where
-+			 * neither get_ll() nor ioctl_get_ll() get's correct hw
-+			 * address, so we have to truncate the :0 and run
-+			 * get_ll() again for the rest.
-+			*/
-+			if ((colon = strchr(dup, ':')) != NULL) {
-+				*colon = '\0';
-+				if ((sll = get_ll(ifaddrs, &ifa, dup)) == NULL)
-+					log_fatal("Error getting hardware address for \"%s\": %m", name);
-+			}
-+			free (dup);
-+			/* For Infiniband, save the broadcast address and store
-+			 * the port GUID into the hardware address.
-+			 */
-+			if (ifa && (ifa->ifa_flags & IFF_BROADCAST)) {
-+				struct sockaddr_ll *bll;
-+
-+				bll = (struct sockaddr_ll *)ifa->ifa_broadaddr;
-+				memcpy(&info->bcast_addr, bll->sll_addr, 20);
-+			} else {
-+				memcpy(&info->bcast_addr, default_ib_bcast_addr,
-+				       20);
-+			}
-+
-+			hw->hlen = 1;
-+			hw->hbuf[0] = HTYPE_INFINIBAND;
-+			memcpy(&hw->hbuf[1], &sll->sll_addr[sll->sll_halen - 8], 8);
- 			break;
- 		default:
--			log_fatal("Unsupported device type %ld for \"%s\"",
--				  (long int)sa->sa_family, name);
-+			freeifaddrs(ifaddrs);
-+			log_fatal("Unsupported device type %hu for \"%s\"",
-+				  sll->sll_hatype, name);
- 	}
- 
--	close(sock);
-+	if (sll_allocated)
-+		dfree(sll, MDL);
-+	freeifaddrs(ifaddrs);
- }
- #endif
-diff -urP a/common/socket.c b/common/socket.c
---- a/common/socket.c	2023-06-21 23:44:22.498212253 -0600
-+++ b/common/socket.c	2023-06-22 00:06:39.769025295 -0600
-@@ -358,7 +358,7 @@
- 	info->wfdesc = if_register_socket(info, AF_INET, 0, NULL);
- 	/* If this is a normal IPv4 address, get the hardware address. */
- 	if (strcmp(info->name, "fallback") != 0)
--		get_hw_addr(info->name, &info->hw_address);
-+		get_hw_addr(info);
- #if defined (USE_SOCKET_FALLBACK)
- 	/* Fallback only registers for send, but may need to receive as
- 	   well. */
-@@ -421,7 +421,7 @@
- #endif /* IP_PKTINFO... */
- 	/* If this is a normal IPv4 address, get the hardware address. */
- 	if (strcmp(info->name, "fallback") != 0)
--		get_hw_addr(info->name, &info->hw_address);
-+		get_hw_addr(info);
- 
- 	if (!quiet_interface_discovery)
- 		log_info ("Listening on Socket/%s%s%s",
-@@ -577,7 +577,7 @@
- 	if (req_multi)
- 		if_register_multicast(info);
- 
--	get_hw_addr(info->name, &info->hw_address);
-+	get_hw_addr(info);
- 
- 	if (!quiet_interface_discovery) {
- 		if (info->shared_network != NULL) {
-@@ -633,7 +633,7 @@
- 	info->rfdesc = sock;
- 	info->wfdesc = sock;
- 
--	get_hw_addr(info->name, &info->hw_address);
-+	get_hw_addr(info);
- 
- 	if (!quiet_interface_discovery) {
- 		if (info->shared_network != NULL) {
-@@ -1246,7 +1246,9 @@
- #if defined(sun) && defined(USE_V4_PKTINFO)
- /* This code assumes the existence of SIOCGLIFHWADDR */
- void
--get_hw_addr(const char *name, struct hardware *hw) {
-+get_hw_addr(struct interface_info *info) {
-+	struct hardware *hw = &info->hw_address;
-+	const char *name = info->name;
- 	struct sockaddr_dl *dladdrp;
- 	int sock, i;
- 	struct lifreq lifr;
-diff -urP a/includes/dhcpd.h b/includes/dhcpd.h
---- a/includes/dhcpd.h	2022-09-28 08:39:15.000000000 -0600
-+++ b/includes/dhcpd.h	2023-06-22 00:07:48.661031051 -0600
-@@ -1284,6 +1284,9 @@
- 
- 	int lease_id_format;		/* format for IDs in lease file,
- 					   TOKEN_OCTAL or TOKEN_HEX */
-+
-+	int bootp_broadcast_always;	/* If nonzero, always set the BOOTP_BROADCAST
-+					   flag in requests */
- };
- 
- /* Per-interface state used in the dhcp client... */
-@@ -1377,6 +1380,7 @@
- 	struct shared_network *shared_network;
- 				/* Networks connected to this interface. */
- 	struct hardware hw_address;	/* Its physical address. */
-+	u_int8_t bcast_addr[20];	/* Infiniband broadcast address */
- 	struct in_addr *addresses;	/* Addresses associated with this
- 					 * interface.
- 					 */
-@@ -2646,7 +2650,7 @@
- #endif
- const char *print_time(TIME);
- 
--void get_hw_addr(const char *name, struct hardware *hw);
-+void get_hw_addr(struct interface_info *info);
- char *buf_to_hex (const unsigned char *s, unsigned len,
-                    const char *file, int line);
- char *format_lease_id(const unsigned char *s, unsigned len, int format,
-diff -urP a/includes/dhctoken.h b/includes/dhctoken.h
---- a/includes/dhctoken.h	2022-09-28 08:39:15.000000000 -0600
-+++ b/includes/dhctoken.h	2023-06-22 00:07:48.662031051 -0600
-@@ -377,7 +377,8 @@
- 	TOKEN_HEX = 677,
- 	TOKEN_OCTAL = 678,
- 	KEY_ALGORITHM = 679,
--	DISCONNECT = 680
-+	DISCONNECT = 680,
-+	BOOTP_BROADCAST_ALWAYS = 681
- };
- 
- #define is_identifier(x)	((x) >= FIRST_TOKEN &&	\


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-02-18 11:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-14 18:26 [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/files/, net-misc/dhcp/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2024-02-18 11:29 Sam James
2023-05-21 20:38 Mike Gilbert
2023-04-28  6:26 Sam James
2023-01-20  3:48 Mike Gilbert
2020-11-20 19:29 Mike Gilbert
2020-11-18 17:09 Mike Gilbert
2017-09-19 22:44 Tony Vroon
2017-08-01  7:46 Lars Wendler
2016-03-30 10:23 Lars Wendler
2016-01-13  9:45 Lars Wendler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox