summaryrefslogtreecommitdiff
path: root/net-misc/dhcp
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/dhcp
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/dhcp')
-rw-r--r--net-misc/dhcp/Manifest42
-rw-r--r--net-misc/dhcp/dhcp-4.3.4.ebuild264
-rw-r--r--net-misc/dhcp/dhcp-4.3.5.ebuild263
-rw-r--r--net-misc/dhcp/dhcp-4.3.6-r1.ebuild263
-rw-r--r--net-misc/dhcp/dhcp-4.3.6.ebuild262
-rw-r--r--net-misc/dhcp/files/dhcp-3.0-fix-perms.patch15
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch70
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch14
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch14
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch113
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch46
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch29
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch72
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch19
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch15
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch411
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.3-ldap-ipv6-client-id.patch81
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.4-bind-disable.patch38
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.4-dhclient-ntp.patch209
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch210
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch422
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch11
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-lmdb-removal.patch12
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch66
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch66
-rw-r--r--net-misc/dhcp/files/dhcpd.conf228
-rw-r--r--net-misc/dhcp/files/dhcpd.init5119
-rw-r--r--net-misc/dhcp/files/dhcpd.tmpfiles2
-rw-r--r--net-misc/dhcp/files/dhcpd4.service11
-rw-r--r--net-misc/dhcp/files/dhcpd6.service11
-rw-r--r--net-misc/dhcp/files/dhcrelay.conf16
-rw-r--r--net-misc/dhcp/files/dhcrelay.init333
-rw-r--r--net-misc/dhcp/files/dhcrelay4.service10
-rw-r--r--net-misc/dhcp/files/dhcrelay4.service.conf3
-rw-r--r--net-misc/dhcp/files/dhcrelay6.conf8
-rw-r--r--net-misc/dhcp/files/dhcrelay6.service10
-rw-r--r--net-misc/dhcp/files/dhcrelay6.service.conf6
-rw-r--r--net-misc/dhcp/metadata.xml17
38 files changed, 3301 insertions, 0 deletions
diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
new file mode 100644
index 000000000000..8f10b0f66678
--- /dev/null
+++ b/net-misc/dhcp/Manifest
@@ -0,0 +1,42 @@
+AUX dhcp-3.0-fix-perms.patch 417 SHA256 eb16050fcd672a4e37122e65b41d4fe57498c117a219d5c9dd671cc9b5405daa SHA512 7b5b607f62dae3075c9126ce0055b649a9c1fc5c0d591f40208d0c951c2a921ced63c7a4c7b78e82e463c57cffc90734b23ef51b69fe70ecb8ad366ddca97cc7 WHIRLPOOL bf8fed0bcbf43becc20e0256abee087fdba1a2903d225969cd4c83ecb8ec5e537dce0fae4a1bf9cbc66c130c0961b9d2c24ada890a00593a917b6c163bd4632c
+AUX dhcp-3.0.3-dhclient-no-down.patch 2336 SHA256 c1cdbe23cd29674668769cef8107d7a580c8d733a74b2b15dd96f21c5810c7cd SHA512 3e08934aba6397503b7440465d123694506236856e607cb2dca42cc0122f96c87664bb28f608a908fe4edfdb49f7434720749ae253c7f6b9d78abb318cc318b2 WHIRLPOOL 0d0a330f1adc184b756ef481015a016c4ec2c9fbc3b5d8571688e1f1f6947b930b6fea644e8dab9e88ad8b6427120042bd1c2feece185df769c02b64d102df30
+AUX dhcp-4.2.2-bind-build-flags.patch 476 SHA256 a16d9da5fc29c95c46cf7e2401744292b898f692d49dea4753991505e03c1ca8 SHA512 f552f2b8b1e13e22636f8e4548557801273b0ab38f076a141adb72584ad55b4da156401d94abd12e9364b8632a6e75ecbf3cd90af3b6dbad88627ad3f9658059 WHIRLPOOL 3202f614747eaa9b533e36495bfa862eb96b3e884cb4939a8406fdbded56061aabea20e9249d647e6aa8ed5ed5547d5c8f14c46af193c248239a2734dc79411a
+AUX dhcp-4.2.2-bind-parallel-build.patch 304 SHA256 cff322da581742ef1a8019641ee9689c588c3f9fef883b55e28af52823f08838 SHA512 3dee3b0ae5bd512bd7be6d5be7b8cfca8077065f6a3463089bf9ff5fcb556b3333fb8d3aeadf25ea7125fb6eff2ef6967b2878c9312046fa378c8acf0c9cf9d2 WHIRLPOOL 4dbc45c32b7da7cb6f591356290f598308083af3df309cd8e6908b586cbec3dfa6d7d582a3f3675112ff46a15db9c0e1abe727b8b8b4c2168c21a97905f9fb13
+AUX dhcp-4.2.2-dhclient-stdin-conf.patch 3017 SHA256 701da4d022490bf9e1cfd946c752a00a2d2ab9a1fd5030281c1608f367cc68fe SHA512 1adfa938e5531040008981dd4dcba37219bce0794524d3c3530eff527528ef7b22aa6fd540f9ac175339372e98347c0a91b86b4bb5f2aa93f04217b9902c3388 WHIRLPOOL c42b3880b5cf710613021c192fc5bc1290bd04db9d79b991bac9e361f58fd84514044a19a5eff82695845e017c996cd46b29b697bfe718e51fba413caf925096
+AUX dhcp-4.2.2-nogateway.patch 1671 SHA256 3fed5823812c134e1819c8ac10c5fc718df86f4013ffc7505efbbe692319480e SHA512 fefbb402020dfdc3eff75da50bfaed0f30c5b90facd4b4ca25ac38d62f14bb85b18028261b32ac3f4654afc8e6915fcdd6f5e580444f2efe882f6f75ea10be0c WHIRLPOOL 91d38301aaecc4a2199ffd0be19d5c2b36531446524aeb65e743adb82220d20b18f53f3e740b5286bdf578f8fd35b2511f52747406b914d1c4d2841d1677e1bd
+AUX dhcp-4.2.4-always-accept-4.patch 907 SHA256 2a876b92ff385e97955279eab8d7658b9a323cdf16c4a162ba649166cae10194 SHA512 682583d3a68b9609b16ba5029fb14a068c5e4ba1134b91e3c5c91f8cfa0d97d68e7b0fec2aa3d4e224bef9e97765971ca423e54f853a74ff6a2e24715ce17a2c WHIRLPOOL 27516c02bcece28eac935f2a6fbfbf64e3b31b75206151ec618daa906b21a40b62497cefe2e793c1ae74b0b4ee5decde363c9908a632bb38513e14cbb64347e5
+AUX dhcp-4.2.4-quieter-ping.patch 2771 SHA256 8acf6266190a76f13c942da5c0a52c38421259f3fd63426134ad245e65081db0 SHA512 1a17a7ca52aa2a56e483e5f70e9878d7472f8eb3982b4f04c6cb3c32f839fa3972f79f632f99f47196a7e7b9fd8826392b94daaa074691d26636b793fcd40e73 WHIRLPOOL aa0b2bc3f3c539eaa6de27f9ce98525c5342af9a257cf36b8889b40455b3264f7b824a615146539ab012bcf4e5a55a7f1992cfc6222ce77976709c1a88dc907b
+AUX dhcp-4.2.5-bindtodevice-inet6.patch 826 SHA256 482dea1517e3d7a22c0469908c41c0595455b654968e24a31e2053af8b11aa30 SHA512 74d9d30b4803d10a63843d474dda92f019e4b7b9d7a9f4e32a49a1c261c1bb7238cd13f9b91c2bf8cf7f3ce5a5c665ef1d32998b06ca1439b30785d33827fe67 WHIRLPOOL 78b09180b95a4629c383d4347dd6ae55c83987f3c8946eb71a7643a442d59bfb63b3decbdc3fa3bc4e608c6d8ab59c3904eb027e97dcdbba169ca51ff0ced6c2
+AUX dhcp-4.2.5-iproute2-path.patch 340 SHA256 a6c25d408ca1bac5180151ff2955807017c386c06fc162395dcd71040900f59b SHA512 4a5c4f3b1af93fa137d94fd860689919b83de5885198e48eb89678379a59a7c9d90f8a3f558ddf9d442130abb127a460928a85c0646c4ad0984827ccd9e08852 WHIRLPOOL d54ba0f4c3da34375ab0f1fa98368ad4ec4f6ff79a131638a3d6540a4c2fa62e83cb45f946518b114793ad8e868b6cef9ec9338a4930080623439e7692386d77
+AUX dhcp-4.3.1-dhclient-resolvconf.patch 14574 SHA256 9f1d8d987e62679d246c70dbc5149090ce1c382b7256c003f2852dd6617a335b SHA512 0cad400e5517ad9b66fc9aa09b2455809205eeb686dce6c7cc4efb8ea655d8de436f47b91ccf8fbd2c4286ecbb2b9d761b7e60e72ab7456794f3028739d80efe WHIRLPOOL 3a021da8fd0069e668ea79d13e496f40976202dcdfa95e78ef3182a6aafa787cd1cafaaa99c1a8e3655f8d15e989d771173c8add54f93b4b332426cd5863e63f
+AUX dhcp-4.3.3-ldap-ipv6-client-id.patch 2095 SHA256 8f075b1744ae66a27823d318dee04311aef193db026225edb897c84cb71077ed SHA512 c8e48bc405d75281790c44c48d89c27b9ec7dd7273c41cacdc0e5e3b08648ae0eda1bd9b308a19667f11703b4bb25fc94911036bcca11f1197f87ec265b0c35a WHIRLPOOL 5066ae69710003aefcfad223b6363b0b1957bcc67c48116053c3dd9c9b4b85b7fc23630578236aa47c3fe8c842c59fd97454699eb1033511272b81f1c12cacad
+AUX dhcp-4.3.4-bind-disable.patch 1300 SHA256 31930e11715d665a9737eb3e3e3386b7af999e2b4c7b62240c8e929eb57aab61 SHA512 0684b6150a14d3ed5bbf1282cd22c4a03a761dc5197e5ada713c32fc821014279ddd8bd64e9ba46fef1b333f5a3b52e20b9a349311be49402b0942681f934f1e WHIRLPOOL a65827f869866edbfc309e0fa24264455ec0171284b4d785a7f745087b43f670dba8d762b26e6d125e76b53759b2162dd70a4bcd0196c3454b79dc6907f45a31
+AUX dhcp-4.3.4-dhclient-ntp.patch 6883 SHA256 e4abe9a120d18b490d482c2df5e5a0f4a62ce4b8e4669a4d9896e601ffd6d169 SHA512 48d45b6550667f0b6dbba1c1e0bb57c509ace03f056fe3857096aac854bce121f52b499e5f4f1cce29a5104ed737e0ed8836b008da465d58d246799d9780fa74 WHIRLPOOL 28590808e0f436d45175c9849e92d944240f82229263556ec920f85844f5917a428a20852211412d21c8b8820ea43a205213a7efede39a4e6ad340347a1d62cb
+AUX dhcp-4.3.6-dhclient-ntp.patch 6810 SHA256 1a0cf7025ab5fdb75f79137963842f736d1e7a020750c7d8f75501f0486afaf5 SHA512 13e4215c4fe02ea8d17a1559b2653de1bb72675eb72ae7b17707c2cf138fd620406f1d57eea3812f491df475f942e2f44b9b784d5ad5a2f352d455bef3df771e WHIRLPOOL 3bd720923a04437a8bcac29570fdf193efa647c57fc0cbabd4ecf512eb3ce7dcd840a44805e667d7fbed3310e0a0c337ea38bc70cc74616489fff298871596a5
+AUX dhcp-4.3.6-dhclient-resolvconf.patch 15340 SHA256 41d64994fcb2ccd8a2bb7a4a1970fff26612818e77286babb5a9a66b120bb36a SHA512 264a2e073a80109c9dced6a3f7834f958990a15e578dd1435128e7ef9335b0b9751020166fbb0e1b01193c19eb28322648226fc5a1b07dc0b9452b702903cc8d WHIRLPOOL 2f65303ef291c2be8e602259599498effda034ea63b5f77775bad978151bbf08658fb33f4c1ced6459e44f4d037d26a318ec8d4226995d7b587fe3191db2de49
+AUX dhcp-4.3.6-iproute2-path.patch 451 SHA256 168f0a66b6c6a7a61e352ef522b2331700f5ef82d481b06003388b2577960ec7 SHA512 91f20102e41cef81253617c80ba4d8193f35f51419606ab62e01f07153f1f616c70e0c43838c3d83913402f8d02ff333e4e36e08efd50aa8f8fe83939f91ae3e WHIRLPOOL b18790dccfe68e84786430d1476e7d5ba6e85185ace55786f686109d0906e0f77504a0cd208236c76f26199408c670cfd2d4a2d0c3b4c9161166705f3a615660
+AUX dhcp-4.3.6-lmdb-removal.patch 569 SHA256 e40b183fb23e9b72c75c5697a3945fa7a31cc33ba863ea19dc0d0e81b49e6e71 SHA512 802be48012a627fb83114fee9cd0d2ec7f161955f19aa9ec0d51279208c4e8dd99f2a24d5132631cc5f45c17732971f7abd3f6d292b6c4e865645a3469a5c08a WHIRLPOOL c0ae6ff367f20ffe5438d37b1f71cb707c92739827e90d655d2dcb9d2e00a0b4d33ef4ececd9aa1f0a03385f665e2c18104d278e32186cd800968e086fb1b8fc
+AUX dhcp-4.3.6-nogateway.patch 1904 SHA256 5c07496cbfaf767747416108a5ee55d278f64034009f9a3591bff1f048e68304 SHA512 571320f652ba5b24813ce9707f333f1d44d09c046c6371c86d011bd9d1c3c1288918851df336a881a62c6c095b6ac3bd9699f022e6f30dbb2542157b10ec20f7 WHIRLPOOL 5eddedeaaefee7a84271174c3e258016133822c383cdce439a2ff578bd9fa29c9075e29d5983a128bdeecdafc2a71be8365b2ca3560f4d61b487ebf6ecde4a6d
+AUX dhcp-4.3.6-quieter-ping.patch 2622 SHA256 74406d7ce442d50652ef91ed1494ed18c4896699bbc855222193f5854f52a9e5 SHA512 4338ca0fd733676ed6ecc790cd5305b9eca468a9be206f0a1d195d024974aabdb7def81d2181261d3b6033fd4e9b5461c07adfb3b16d1df1dc2e5f819c90ba47 WHIRLPOOL 292ee1783ae3da66d5b255d1cca0b44d5291eb10a3fbf1946ac9a7b777fbc2205e37ea9953611b2a84347856c02cf72addd2526caed7332d6f204d2ef0b8351d
+AUX dhcpd.conf2 1068 SHA256 e8a413e9102948b336f60041fc3cade33125faf56d8319ee65d9f3c63199a8e7 SHA512 7b7a77b7826b475a4113ebeee54501ce417cc56e85754301a82a185d88b4713d198f615a366e63e0e2b0aef988c8137dcd1e18c4036d993378257079da17693d WHIRLPOOL eef0331ee019b561de2f3e46860d2c470f6de05be9104f46316d61b09bad9687d916af94eb4b399612bfd05340cda5f68f87886200801de485bd3665cc0886b9
+AUX dhcpd.init5 2882 SHA256 974fcd6c3c7d49cf350a53df56c0f73fc64fa14d1516d50dee1316e577ab6450 SHA512 0cf238f3e79ee5d1ba059331664fd092d025ecb8fdb3f1d428713d7cd81ad4efe10ad7ad4ef48146aa6c9763293c1641057a257480e58a639fc6cc20e623f4c1 WHIRLPOOL 275f885c0bc5d49a60cc80c3814feb7d5789e23a3a27c89cbb5909e5c20fe1e057f7a0df714c21c63c3d69e8f235226a559e9da71fcae1e4af4543e4034b1cca
+AUX dhcpd.tmpfiles 75 SHA256 bb344a11fadedaec33ba3c504cc04adba34b15aeb07a640dab6da255de97728a SHA512 0c34ab0ef8618e6792ba8bda797877ce2e6c4fa433b4944dbc03cc4fc69efe26ce4b5e4dec661fbb2b7ae4173d908de02f4e86f8539364789a23f36cfd8edacb WHIRLPOOL fd4450a697cfbdca4db49eb433c7f67e7a9051541f4ab6e2633659435a504b051aad6338257ece4e5fc950c46f9fa7d5c5820f750440325fc62cae79dff2cfb0
+AUX dhcpd4.service 264 SHA256 174e1a7dab5b23bbbd73a9fe16d3907923c21d2802c51dc1096c9e24bfa9fda3 SHA512 e340311fb890c5fc2f5836cc8d10ea3e4bb34bb5e96e7231798e7d960f05886478bf28305828fbd851080baadafe7d3fd2c7f30a81dcbc68d6368e8b4bd0de71 WHIRLPOOL 121ed7c50b179a7d09f53c758e5d44cd9e91451ca7b577d9b058d8097473df421715018986c314d633a599541d422cbda276831ba8c192c2a8762608fc5f2a3b
+AUX dhcpd6.service 270 SHA256 82efa0887779b8c0f5c33ab77274ff9617f8cca0f59816e0e9425e368f1a1824 SHA512 2898f0dfa56ecb590c25a1f0e44446a83d1d9118e691c9a7680250a9e47f4dec2b36195dbda8259292d93a31bf0e1230b9f39ad93f2b0a9280e8cc4d77b50bae WHIRLPOOL 3040add013f776f1c91624c916456f68307321bd2e2cf69616ac2343743d65dfb9e940bffff089c0c45912d7498c666fcff77b4250ef3c533e1028270d9a4c55
+AUX dhcrelay.conf 547 SHA256 a157630c3bdc9565cca8240ee1e6539fc9cbc1e4642c40e0965e3609d1021bac SHA512 af94d679c5b7652a770d4acb96f5f12fd9dc99f4e8e26b10fab67514693f63392bc8033a6e5e6c1967d7004decc72b810462e1fe92c1d4808606e48086dea00b WHIRLPOOL 344ce23b6b6c8e5d87306dd6052036656d202149a7b65245e7eb010236abf43b60b0c4b999df4080c5d9a8fd9315f068cac4184680a023f1b5f5461937d45763
+AUX dhcrelay.init3 701 SHA256 87082ebc37a969d2b7e658f155f96990c57ecb60c5fc23edee25afa9d247bd68 SHA512 ab4c38c53bf21dccee252358f0ecece81829048a546f380cb1e3552804e412c38dac09805fb7f9520531d48d3d79b3dd228ffdba7203b89ac30a778a579ddbda WHIRLPOOL 09357e2ef5f540bcf1c86f81b7516b96b376e47aa1d0061c9adaba7448cd169eff0c64b54d52287c93e711401efa2692d4058a3b434e4af83b44710cfdf41880
+AUX dhcrelay4.service 202 SHA256 9c10299c70c9c63ebe8e1a58c73dfb78f08732f0da1bb3265f1ad6e80f7d79ec SHA512 fcc41f7bc055a3f32f288536d93447c1d0b9f112196a3864e12668a9c844d60f99f01f991846196ec53034d65da076276fa633069308b8f674e9a2af20e107e4 WHIRLPOOL 88a8260d057965965173c7f5efdeb26730c3bc4c6bd09bb675db122972a0c545ace05e44df538ab8e05b7c0ff3fbbdd42f148541f8a50eafff29423c52e8455b
+AUX dhcrelay4.service.conf 105 SHA256 c47b40a940fef418941168d72345576a336d1caf42504256400fbcc421ee9e8a SHA512 e4dcde2fe30e26b0f24102c63a6204cf9e98924246609a957b4881c1cedc6a30500511b1c107f8cc1e5f6d5afbd28468bd47f12d38000d25605a982e15027f8f WHIRLPOOL fc8c7dc20a3b2b2355c1561c1627265340b6bbe356cb96291ad8b2e306c34d308e3371ecd58336003b932e583a68ba25541eb2d687177b5101e8da6927769f17
+AUX dhcrelay6.conf 325 SHA256 099f668e1ad42ed9446b15675032a1186715d1fe9e4a1b24dfb787e68495d2b6 SHA512 40d3a6bdf8521bf5152cf31b961aea88b2fb0339433d0b6a6360a16c796298620b377bd079c0246e97bc9c0533ddb13bbb58cc5169d0ca598e3a51d1a607a9e9 WHIRLPOOL 7fcb1b63d12b066c6fc2668497d18ae33b739cca4dbcbc95530d762c7152c410a0af76e65ebb21f3c9c4a837b999799da4a766315e5eb667ccde64100b66b6fd
+AUX dhcrelay6.service 237 SHA256 5406caf5355a71396895a3ef49c3a0af29aa9b982cb10541590fd55dbc1c878a SHA512 11d17aebef403fce1f3b0514f1c7206cb6520f1712c603b016c11275a83e102b969cc371dbe5a3a9c430a392dedf0c7af33692a49197092c467ea764dfaede9d WHIRLPOOL 4dc79fd4fbdea4ea585f6df777e24591876fe8fef21defcaeac676e384137f43695d69fc8ddb5f91d233f47481349e2951fd3c9411aafb00d2fcf161025192ac
+AUX dhcrelay6.service.conf 220 SHA256 c8ef2c5d930ad0addd1a4a10576db271f50cc3e81ac8f87b8b56fb759ab65bdd SHA512 2ac54a5ebdf009854700e6f6b70662b36787b71a5b917fc61be35d31762508ede0e81b3874965b91de655a088914dbe43927911d8df1a16c262cb68389c168a9 WHIRLPOOL 70bba913342e6a1b492eda9799146e48c612175f227b1337874b904bcf22251389d10a4b79c90519b248cdd594288f8d31396e2e8475bb8e28d019c9e9382a88
+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
+EBUILD dhcp-4.3.4.ebuild 7926 SHA256 ea2a3dd582f2b81f7bf310620f830eb27cd44b7b54ed058f1c5b791617a07d7f SHA512 e31df7b37c57c8f9557f965b5ad9763252ead3b1911a56938c6a007fea84726e09eae935ea13a682e09cd0c06af11fa8b5f07f568829f4dc8aa7ed2279488967 WHIRLPOOL 9b0ef5b2ef945a7a5b888a900ea3828224c4c6aa8181f8c99002db8b661e261b015fae71bf12d5b067730c03f93d9cd2be972d490ab29aa5b69bb59f8b9935b2
+EBUILD dhcp-4.3.5.ebuild 7897 SHA256 623f8b8867335dcf63b0823a5663085ae228ecd551f2f6a28f4c791e04fdf0bb SHA512 b9ff72caaaf65cf208c42fa0ab21974a90d72bd16a598d274c3b6f681e3b0f916de1dd2a8efa6543d955aa64f831591856257932d7e754313d2217a2be79705f WHIRLPOOL 78272e51cf2906f43fba6ff19e36fc26a4e600312d32b37dff2f207c1adaf8d21423547c15e26d674d9cd4c5c86fdfcc8936ebe709b13499b0ee922a02685b5b
+EBUILD dhcp-4.3.6-r1.ebuild 7835 SHA256 28b710b208cdcca9a1a1303a51db6dbb86d54ca8a2983320c44bc3e3a1859729 SHA512 43dfbe8d6cad25a4a579a107d99495ee0fe053c0f8b6209a1332599d9f88cb44efa66a8dac9c050796af510525109fc2baff0dd8431f7eb30f84356fba2337e0 WHIRLPOOL 387b35fa10da044afa238df0b9440c9455ca3de503781434644235ee58369bca566a235347f495273aa9ceddffc646a0ead1b78d3a34da0715354c74bd3be267
+EBUILD dhcp-4.3.6.ebuild 7781 SHA256 de01f9ffbed3483790f3e13578c3b970e698b4b5453ac27d2d04f90f2ded44dc SHA512 a1c76b0b661232b5f9da69aaf399a82581f0c782f85d3c54270b7b9f21aed44a248ce79e6cf516b4755a758dfc418f5b4bc1fc1dc8f68bdaebb1d01e54ea09b0 WHIRLPOOL 2df302edd1a11010dbaaf74720a34a8aa845b0c6f23979388d6c6831062552be5557eb574978fbe3509f0d0f84da2ca6166d810b974bb59b181d6151e7c78990
+MISC ChangeLog 8845 SHA256 3a93dc77c940ccf89ce2007c88120bbb3897d8c407606a2820bc676269170a0f SHA512 ec67e3a954f541b77505964b66b33432f282bc01e6b0e3e9ed87f3befbec8da0115e94faabec0caaf6f522b07c49d098044e541ef2c3bd80aa999634e20f005f WHIRLPOOL 0d89b1bdd32a974e5d93d24db5c1ad88fd152fa80466fa755f0ed25432e2347a4c8eaef0bb7bcf187097859b1062007c96ca00f0ebfd3533fdfedaa362fa75ee
+MISC ChangeLog-2015 45869 SHA256 4ecdf10709b9f18ac882964016845fb0ab6301b371737bac00f16e502e2e5cbb SHA512 8bf8c70ae26a84c12a3fed004988e326156489b71bcd58fdc8280bc850579bd2effaeade32d5f7b2211fab166735c6150c42216c142fe725ffa700a8cf4787da WHIRLPOOL e60841911423b37e2f09f31a5e3e767654021a8698f4780a806e492bf9076b70c34af838d55d099a43094882286db2445dce18777da27a8397cc5d168ee82783
+MISC metadata.xml 669 SHA256 cbcded236fe8be217623e19c58fb5d9d6871df496cf6d53909dd033092b26fff SHA512 854b5b781642506f45df585d2072a79164620ec16e2b59abe2ef55e474f229d676f69f4820b4db1f6dce04df55bc5e3a20bcff959a34b3cc41bf61cce31f1efd WHIRLPOOL 10cb7de7f46793fad8ff9c42c21aa3bc5c571258251997ca3e9f26cfd804eeddf07faf45f8a38287c184f5f47f8de96ea9fa56d198d1424249b42de8a16af06f
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 000000000000..85c68bfb0f31
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.3.4.ebuild
@@ -0,0 +1,264 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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/dhcp-4.3.5.ebuild b/net-misc/dhcp/dhcp-4.3.5.ebuild
new file mode 100644
index 000000000000..aff36679d428
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.3.5.ebuild
@@ -0,0 +1,263 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 || 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
+ epatch "${FILESDIR}"/${PN}-4.3.4-bind-disable.patch
+ cd bind-*/ || die
+ epatch "${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
+
+ 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/dhcp-4.3.6-r1.ebuild b/net-misc/dhcp/dhcp-4.3.6-r1.ebuild
new file mode 100644
index 000000000000..32b0629c9379
--- /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/dhcp-4.3.6.ebuild b/net-misc/dhcp/dhcp-4.3.6.ebuild
new file mode 100644
index 000000000000..2404129b81ee
--- /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
new file mode 100644
index 000000000000..f4b3fd18e167
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
@@ -0,0 +1,15 @@
+--- a/server/dhcpd.c
++++ b/server/dhcpd.c
+@@ -602,6 +602,12 @@
+ if (lftest)
+ exit (0);
+
++#if defined (PARANOIA)
++ /* Set proper permissions... */
++ if (lchown (path_dhcpd_db, set_uid, set_gid))
++ log_fatal ("lchown(%s, %d, %d): %m", path_dhcpd_db, (int) set_uid, (int) set_gid);
++#endif /* PARANOIA */
++
+ /* Discover all the network interfaces and initialize them. */
+ discover_interfaces (DISCOVER_SERVER);
+
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
new file mode 100644
index 000000000000..3a3b956e3616
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
@@ -0,0 +1,70 @@
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -118,9 +118,9 @@
+ 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
+- ifconfig $interface 0 up
++ ifconfig $interface 0.0.0.0 up
+
+ # We need to give the kernel some time to get the interface up.
+ sleep 1
+@@ -145,12 +145,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 ] || \
+@@ -171,7 +171,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
+@@ -183,11 +183,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
+@@ -198,7 +198,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
+@@ -223,7 +223,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
+
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch b/net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch
new file mode 100644
index 000000000000..ae33638284b8
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch
@@ -0,0 +1,14 @@
+bind sets up BUILD_XXX vars for building native tools, but then
+doesn't use them for the "gen" tool
+
+--- a/bind/lib/export/dns/Makefile.in
++++ b/bind/lib/export/dns/Makefile.in
+@@ -166,7 +166,7 @@
+ ./gen -s ${srcdir} > code.h
+
+ gen: ${srcdir}/gen.c
+- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
++ ${BUILD_CC} ${BUILD_CFLAGS} ${CINCLUDES} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS}
+
+ #We don't need rbtdb64 for this library
+ #rbtdb64.@O@: rbtdb.c
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch b/net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch
new file mode 100644
index 000000000000..6136154f65a0
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch
@@ -0,0 +1,14 @@
+fix the bind subdir parallel builds
+
+https://bugs.gentoo.org/380717
+
+--- a/bind/lib/export/isc/Makefile.in
++++ b/bind/lib/export/isc/Makefile.in
+@@ -114,6 +114,7 @@
+ -DLIBAGE=${LIBAGE} \
+ -c ${srcdir}/version.c
+
++${OBJS}: | subdirs
+ libisc.@SA@: ${OBJS}
+ ${AR} ${ARFLAGS} $@ ${OBJS}
+ ${RANLIB} $@
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch b/net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch
new file mode 100644
index 000000000000..bf5a54c32153
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch
@@ -0,0 +1,113 @@
+--- dhcp-4.2.2/client/clparse.c
++++ dhcp-4.2.2/client/clparse.c
+@@ -182,6 +182,10 @@ isc_result_t read_client_conf ()
+ #endif
+ }
+
++ /* Read any extra configuration from stdin */
++ extern int read_client_conf_stdin (struct interface_info *ip, struct client_config *client);
++ read_client_conf_stdin (NULL, &top_level_config);
++
+ /* Set up state and config structures for clients that don't
+ have per-interface configuration statements. */
+ config = (struct client_config *)0;
+@@ -211,23 +215,13 @@ isc_result_t read_client_conf ()
+ return status;
+ }
+
+-int read_client_conf_file (const char *name, struct interface_info *ip,
++int read_client_conf_actual (struct parse *cfile, struct interface_info *ip,
+ struct client_config *client)
+ {
+- int file;
+- struct parse *cfile;
+ const char *val;
+ int token;
+ isc_result_t status;
+
+- if ((file = open (name, O_RDONLY)) < 0)
+- return uerr2isc (errno);
+-
+- cfile = NULL;
+- status = new_parse(&cfile, file, NULL, 0, path_dhclient_conf, 0);
+- if (status != ISC_R_SUCCESS || cfile == NULL)
+- return status;
+-
+ do {
+ token = peek_token (&val, (unsigned *)0, cfile);
+ if (token == END_OF_FILE)
+@@ -238,10 +232,74 @@ int read_client_conf_file (const char *name, struct interface_info *ip,
+ status = (cfile -> warnings_occurred
+ ? DHCP_R_BADPARSE
+ : ISC_R_SUCCESS);
++ return status;
++}
++
++int read_client_conf_file (const char *name, struct interface_info *ip,
++ struct client_config *client)
++{
++ int file;
++ struct parse *cfile;
++ isc_result_t status;
++
++ if ((file = open (name, O_RDONLY)) < 0)
++ return uerr2isc (errno);
++
++ cfile = (struct parse *)0;
++ new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
++ status = read_client_conf_actual(cfile, ip, client);
+ end_parse (&cfile);
+ return status;
+ }
+
++int read_client_conf_stdin (struct interface_info *ip,
++ struct client_config *client)
++{
++ int file;
++ char *buffer = NULL, *p;
++ unsigned buflen, len = 0;
++ struct parse *cfile;
++ size_t bytes;
++ isc_result_t status;
++
++ file = fileno(stdin);
++ if (isatty (file))
++ return ISC_R_NOTFOUND;
++ if (fcntl (file, F_SETFL, O_NONBLOCK) < 0)
++ log_fatal ("could not set stdin to non blocking!");
++
++ buflen = BUFSIZ;
++ buffer = malloc (BUFSIZ + 1);
++ p = buffer;
++ do {
++ bytes = read (file, p, BUFSIZ);
++ if (bytes == 0)
++ break;
++ if (bytes == -1)
++ log_fatal ("failed to read stdin!");
++ if (bytes >= BUFSIZ) {
++ buflen += BUFSIZ;
++ len += BUFSIZ;
++ buffer = realloc (buffer, buflen + 1);
++ if (!buffer)
++ log_fatal ("not enough buffer to read stdin!");
++ p = buffer + len;
++ } else {
++ len += bytes;
++ break;
++ }
++ } while(1);
++ buffer[len] = '\0';
++
++ cfile = (struct parse *)0;
++ status = new_parse (&cfile, -1, buffer, len, "stdin", 0);
++ if (status == ISC_R_SUCCESS) {
++ status = read_client_conf_actual (cfile, ip, client);
++ end_parse (&cfile);
++ }
++ free(buffer);
++ return status;
++}
+
+ /* lease-file :== client-lease-statements END_OF_FILE
+ client-lease-statements :== <nil>
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch b/net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch
new file mode 100644
index 000000000000..27fb2b0e6025
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch
@@ -0,0 +1,46 @@
+http://bugs.gentoo.org/265531
+
+--- dhcp-4.2.2/client/scripts/linux
++++ dhcp-4.2.2/client/scripts/linux
+@@ -193,12 +193,14 @@
+ ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg
+ # Add a network route to the computed network address.
+- for router in $new_routers; do
+- if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+- route add -host $router dev $interface
+- fi
+- route add default gw $router $metric_arg dev $interface
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ for router in $new_routers; do
++ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
++ route add -host $router dev $interface
++ fi
++ route add default gw $router $metric_arg dev $interface
++ done
++ fi
+ else
+ # we haven't changed the address, have we changed other options
+ # that we wish to update?
+@@ -244,12 +246,14 @@
+ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+ route add -host $alias_ip_address dev $interface:0
+ fi
+- for router in $new_routers; do
+- if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+- route add -host $router dev $interface
+- fi
+- route add default gw $router $metric_arg dev $interface
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ for router in $new_routers; do
++ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
++ route add -host $router dev $interface
++ fi
++ route add default gw $router $metric_arg dev $interface
++ done
++ fi
+ make_resolv_conf
+ exit_with_hooks 0
+ fi
diff --git a/net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch b/net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch
new file mode 100644
index 000000000000..6cec86c9d9c4
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch
@@ -0,0 +1,29 @@
+https://bugs.gentoo.org/437108
+
+always accept the -4 option even if we don't have IPv6 support enabled.
+the relay code does this already.
+
+--- a/client/dhclient.c
++++ b/client/dhclient.c
+@@ -170,8 +170,8 @@ main(int argc, char **argv) {
+ if (!strcmp(argv[i], "-r")) {
+ release_mode = 1;
+ no_daemon = 1;
+-#ifdef DHCPv6
+ } else if (!strcmp(argv[i], "-4")) {
++#ifdef DHCPv6
+ if (local_family_set && local_family != AF_INET)
+ log_fatal("Client can only do v4 or v6, not "
+ "both.");
+--- a/server/dhcpd.c
++++ b/server/dhcpd.c
+@@ -373,8 +373,8 @@ main(int argc, char **argv) {
+ } else if (!strcmp (argv [i], "-q")) {
+ quiet = 1;
+ quiet_interface_discovery = 1;
+-#ifdef DHCPv6
+ } else if (!strcmp(argv[i], "-4")) {
++#ifdef DHCPv6
+ if (local_family_set && (local_family != AF_INET)) {
+ log_fatal("Server cannot run in both IPv4 and "
+ "IPv6 mode at the same time.");
diff --git a/net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch b/net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch
new file mode 100644
index 000000000000..66a1fcd79461
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch
@@ -0,0 +1,72 @@
+https://bugs.gentoo.org/296921
+
+`ping -q` will still print out summary information. send that to /dev/null.
+
+patch by Martin Mokrejš
+
+--- a/client/scripts/bsdos
++++ b/client/scripts/bsdos
+@@ -251,7 +251,7 @@ if [ x$reason = xTIMEOUT ]; then
+ 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
+--- a/client/scripts/freebsd
++++ b/client/scripts/freebsd
+@@ -284,7 +284,7 @@ if [ x$reason = xTIMEOUT ]; then
+ 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
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -253,7 +253,7 @@ if [ x$reason = xTIMEOUT ]; then
+ ifconfig $interface inet $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 inet $alias_ip_address $alias_subnet_arg
+--- a/client/scripts/netbsd
++++ b/client/scripts/netbsd
+@@ -251,7 +251,7 @@ if [ x$reason = xTIMEOUT ]; then
+ 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
+--- a/client/scripts/openbsd
++++ b/client/scripts/openbsd
+@@ -245,7 +245,7 @@ if [ x$reason = xTIMEOUT ]; then
+ 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
+--- a/client/scripts/openwrt
++++ b/client/scripts/openwrt
+@@ -186,7 +186,7 @@ if [ x$reason = xTIMEOUT ]; then
+ ifconfig $interface $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg $metric_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
diff --git a/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch b/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch
new file mode 100644
index 000000000000..77254c32e2b0
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch
@@ -0,0 +1,19 @@
+https://bugs.gentoo.org/471142
+
+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
+
+ #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");
diff --git a/net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch b/net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch
new file mode 100644
index 000000000000..ea223ed38b6e
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch
@@ -0,0 +1,15 @@
+find `ip` via $PATH and not hardcoded path
+
+https://bugs.gentoo.org/480636
+
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -23,7 +23,7 @@
+ # of the $1 in its args.
+
+ # 'ip' just looks too weird. /sbin/ip looks less weird.
+-ip=/sbin/ip
++ip=ip
+
+ make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
diff --git a/net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch
new file mode 100644
index 000000000000..71d3f2c69dc5
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch
@@ -0,0 +1,411 @@
+resolvconf support in dhclient-script
+
+--- a/client/scripts/bsdos
++++ b/client/scripts/bsdos
+@@ -1,40 +1,46 @@
+ #!/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
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ 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
+ }
+
+--- a/client/scripts/freebsd
++++ b/client/scripts/freebsd
+@@ -11,73 +11,45 @@
+ 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
+ fe80:*) zone_id="%$interface";;
+ 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
+ }
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -26,44 +26,49 @@
+ ip=/sbin/ip
+
+ 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
+- chmod 644 /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
+ shopt -s nocasematch
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ if [[ "$nameserver" =~ ^fe80:: ]]
+ then
+ zone_id="%$interface"
+ else
+ zone_id=
+ fi
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
+ shopt -u nocasematch
++ 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
+ }
+
+--- a/client/scripts/netbsd
++++ b/client/scripts/netbsd
+@@ -1,40 +1,46 @@
+ #!/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$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ "x$new_domain_name" != x ]; then
++ 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
++ 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
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ 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
+ }
+
+--- a/client/scripts/openbsd
++++ b/client/scripts/openbsd
+@@ -1,40 +1,46 @@
+ #!/bin/sh
+
+ make_resolv_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"$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
++ 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
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ 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
+ }
+
+--- a/client/scripts/solaris
++++ b/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.3-ldap-ipv6-client-id.patch b/net-misc/dhcp/files/dhcp-4.3.3-ldap-ipv6-client-id.patch
new file mode 100644
index 000000000000..2a7f8183d4e0
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.3-ldap-ipv6-client-id.patch
@@ -0,0 +1,81 @@
+https://bugs.gentoo.org/559832
+
+the get_client_id func is used outside of IPv6 code, so don't store it in the
+IPv6-specific dhcpv6.c file. otherwise, building w/out IPv6 & w/ldap yields:
+dhcpd-ldap.o: In function 'find_client_in_ldap':
+ldap.c:(.text+0x4774): undefined reference to 'get_client_id'
+
+--- a/server/dhcpleasequery.c
++++ b/server/dhcpleasequery.c
+@@ -33,6 +33,34 @@
+ * DoS'ed by DHCPLEASEQUERY message.
+ */
+
++/*
++ * Get the client identifier from the packet.
++ */
++isc_result_t
++get_client_id(struct packet *packet, struct data_string *client_id) {
++ struct option_cache *oc;
++
++ /*
++ * Verify our client_id structure is empty.
++ */
++ if ((client_id->data != NULL) || (client_id->len != 0)) {
++ return DHCP_R_INVALIDARG;
++ }
++
++ oc = lookup_option(&dhcpv6_universe, packet->options, D6O_CLIENTID);
++ if (oc == NULL) {
++ return ISC_R_NOTFOUND;
++ }
++
++ if (!evaluate_option_cache(client_id, packet, NULL, NULL,
++ packet->options, NULL,
++ &global_scope, oc, MDL)) {
++ return ISC_R_FAILURE;
++ }
++
++ return ISC_R_SUCCESS;
++}
++
+ /*
+ * If you query by hardware address or by client ID, then you may have
+ * more than one IP address for your query argument. We need to do two
+--- a/server/dhcpv6.c
++++ b/server/dhcpv6.c
+@@ -392,34 +392,6 @@ generate_new_server_duid(void) {
+ }
+
+ /*
+- * Get the client identifier from the packet.
+- */
+-isc_result_t
+-get_client_id(struct packet *packet, struct data_string *client_id) {
+- struct option_cache *oc;
+-
+- /*
+- * Verify our client_id structure is empty.
+- */
+- if ((client_id->data != NULL) || (client_id->len != 0)) {
+- return DHCP_R_INVALIDARG;
+- }
+-
+- oc = lookup_option(&dhcpv6_universe, packet->options, D6O_CLIENTID);
+- if (oc == NULL) {
+- return ISC_R_NOTFOUND;
+- }
+-
+- if (!evaluate_option_cache(client_id, packet, NULL, NULL,
+- packet->options, NULL,
+- &global_scope, oc, MDL)) {
+- return ISC_R_FAILURE;
+- }
+-
+- return ISC_R_SUCCESS;
+-}
+-
+-/*
+ * Message validation, defined in RFC 3315, sections 15.2, 15.5, 15.7:
+ *
+ * Servers MUST discard any Solicit messages that do not include a
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 000000000000..be0c032ae763
--- /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 000000000000..207631710e75
--- /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.
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch
new file mode 100644
index 000000000000..a504840dd5ab
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-ntp.patch
@@ -0,0 +1,210 @@
+--- dhcp-4.3.6/client/clparse.c
++++ dhcp-4.3.6/client/clparse.c
+@@ -31,7 +31,7 @@
+
+ struct client_config top_level_config;
+
+-#define NUM_DEFAULT_REQUESTED_OPTS 9
++#define NUM_DEFAULT_REQUESTED_OPTS 10
+ /* There can be 2 extra requested options for DHCPv4-over-DHCPv6. */
+ struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 2 + 1];
+
+@@ -107,15 +107,20 @@
+ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 8 */
+- code = D6O_NAME_SERVERS;
++ code = DHO_NTP_SERVERS;
+ option_code_hash_lookup(&default_requested_options[7],
+- dhcpv6_universe.code_hash, &code, 0, MDL);
++ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 9 */
+- code = D6O_DOMAIN_SEARCH;
++ code = D6O_NAME_SERVERS;
+ option_code_hash_lookup(&default_requested_options[8],
+ dhcpv6_universe.code_hash, &code, 0, MDL);
+
++ /* 10 */
++ code = D6O_DOMAIN_SEARCH;
++ option_code_hash_lookup(&default_requested_options[9],
++ dhcpv6_universe.code_hash, &code, 0, MDL);
++
+ for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
+ if (default_requested_options[code] == NULL)
+ log_fatal("Unable to find option definition for "
+--- dhcp-4.3.6/client/scripts/bsdos
++++ dhcp-4.3.6/client/scripts/bsdos
+@@ -36,6 +36,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ x$new_ntp_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/freebsd
++++ dhcp-4.3.6/client/scripts/freebsd
+@@ -80,6 +80,26 @@
+ fi
+ fi
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -106,6 +106,27 @@
+ fi
+ mv -f $new_resolv_conf /etc/resolv.conf
+ fi
++
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # set host name
+--- dhcp-4.3.6/client/scripts/netbsd
++++ dhcp-4.3.6/client/scripts/netbsd
+@@ -36,6 +36,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/openbsd
++++ dhcp-4.3.6/client/scripts/openbsd
+@@ -36,6 +36,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+--- dhcp-4.3.6/client/scripts/solaris
++++ dhcp-4.3.6/client/scripts/solaris
+@@ -17,6 +17,26 @@
+
+ mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch
new file mode 100644
index 000000000000..ccfdbcf4a206
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-dhclient-resolvconf.patch
@@ -0,0 +1,422 @@
+--- dhcp-4.3.6/client/scripts/bsdos
++++ dhcp-4.3.6/client/scripts/bsdos
+@@ -1,27 +1,25 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+ if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >> /etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+@@ -31,10 +29,18 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/freebsd
++++ dhcp-4.3.6/client/scripts/freebsd
+@@ -11,54 +11,23 @@
+ fi
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient )
+- exit_status=$?
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
+- else
+- if [ "x$new_domain_search" != x ]; then
+- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- elif [ "x$new_domain_name" != x ]; then
+- # Note that the DHCP 'Domain Name Option' is really just a domain
+- # name, and that this practice of using the domain name option as
+- # a search path is both nonstandard and deprecated.
+- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- fi
+- for nameserver in $new_domain_name_servers; do
+- if [ $exit_status -ne 0 ]; then
+- break
+- fi
+- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
+- exit_status=$?
+- done
+-
+- # If there were no errors, attempt to mv the new file into place.
+- if [ $exit_status -eq 0 ]; then
+- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
+- exit_status=$?
+- fi
+-
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
++ # Note that the DHCP 'Domain Name Option' is really just a domain
++ # name, and that this practice of using the domain name option as
++ # a search path is both nonstandard and deprecated.
++ conf="${conf}search ${new_domain_name}\n"
+ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver ${nameserver}\n"
++ done
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status"
+- else
+- if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- fi
+- for nameserver in ${new_dhcp6_name_servers} ; do
+- if [ $exit_status -ne 0 ] ; then
+- break
+- fi
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+@@ -66,18 +35,21 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- ( echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- done
+-
+- if [ $exit_status -eq 0 ] ; then
+- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf )
+- exit_status=$?
+- fi
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
++ done
++ fi
+
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
+ fi
+ fi
+ }
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -35,16 +35,16 @@
+ # update /etc/resolv.conf based on received values
+ # This updated version mostly follows Debian script by Andrew Pollock et al.
+ make_resolv_conf() {
+- local new_resolv_conf
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf
+
+ # DHCPv4
+ if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
+ [ -n "$new_domain_name_servers" ]; then
+- new_resolv_conf=/etc/resolv.conf.dhclient-new
+- rm -f $new_resolv_conf
+-
+ if [ -n "$new_domain_name" ]; then
+- echo domain ${new_domain_name%% *} >>$new_resolv_conf
++ conf="${conf}domain ${new_domain_name%% *}\n"
+ fi
+
+ if [ -n "$new_domain_search" ]; then
+@@ -60,31 +60,23 @@
+ new_domain_search="$new_domain_name $new_domain_search"
+ fi
+ fi
+- echo "search ${new_domain_search}" >> $new_resolv_conf
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ -n "$new_domain_name" ]; then
+- echo "search ${new_domain_name}" >> $new_resolv_conf
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+
+ if [ -n "$new_domain_name_servers" ]; then
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>$new_resolv_conf
++ conf="${conf}nameserver $nameserver\n"
+ done
+ else # keep 'old' nameservers
+- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
++ conf="${conf}$(sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf)\n"
+ fi
+
+- if [ -f /etc/resolv.conf ]; then
+- chown --reference=/etc/resolv.conf $new_resolv_conf
+- chmod --reference=/etc/resolv.conf $new_resolv_conf
+- fi
+- mv -f $new_resolv_conf /etc/resolv.conf
+ # DHCPv6
+ elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then
+- new_resolv_conf=/etc/resolv.conf.dhclient-new
+- rm -f $new_resolv_conf
+-
+ if [ -n "$new_dhcp6_domain_search" ]; then
+- echo "search ${new_dhcp6_domain_search}" >> $new_resolv_conf
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+
+ if [ -n "$new_dhcp6_name_servers" ]; then
+@@ -94,17 +86,21 @@
+ [ "${nameserver##FE80::}" != "$nameserver" ]; then
+ nameserver="${nameserver}%${interface}"
+ fi
+- echo nameserver $nameserver >>$new_resolv_conf
++ conf="${conf}nameserver $nameserver\n"
+ done
+ else # keep 'old' nameservers
+- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
++ conf="${conf}$(sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf)\n"
+ fi
++ fi
+
+- if [ -f /etc/resolv.conf ]; then
+- chown --reference=/etc/resolv.conf $new_resolv_conf
+- chmod --reference=/etc/resolv.conf $new_resolv_conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
+ fi
+- mv -f $new_resolv_conf /etc/resolv.conf
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/netbsd
++++ dhcp-4.3.6/client/scripts/netbsd
+@@ -1,27 +1,25 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
+- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
++ if [ x"$new_domain_name_servers" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+@@ -31,10 +29,18 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/openbsd
++++ dhcp-4.3.6/client/scripts/openbsd
+@@ -1,27 +1,25 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+@@ -31,10 +29,18 @@
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- dhcp-4.3.6/client/scripts/solaris
++++ dhcp-4.3.6/client/scripts/solaris
+@@ -1,21 +1,39 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
++ done
++ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch b/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch
new file mode 100644
index 000000000000..18b04e620c14
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-iproute2-path.patch
@@ -0,0 +1,11 @@
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -30,7 +30,7 @@
+ # 'ip' just looks too weird. Also, we now have unit-tests! Those unit-tests
+ # overwirte this line to use a fake ip-echo tool. It's also convenient
+ # if your system holds ip tool in a non-standard location.
+-ip=/sbin/ip
++ip=ip
+
+ # update /etc/resolv.conf based on received values
+ # This updated version mostly follows Debian script by Andrew Pollock et al.
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-lmdb-removal.patch b/net-misc/dhcp/files/dhcp-4.3.6-lmdb-removal.patch
new file mode 100644
index 000000000000..6f80d7401f57
--- /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
+
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch b/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch
new file mode 100644
index 000000000000..d299cc503f60
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-nogateway.patch
@@ -0,0 +1,66 @@
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -242,20 +242,22 @@
+ if_metric=${if_metric:-1}
+ fi
+
+- for router in $new_routers; do
+- if [ "$new_subnet_mask" = "255.255.255.255" ]; then
+- # point-to-point connection => set explicit route
+- ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
+- fi
+-
+- # set default route
+- ${ip} -4 route add default via ${router} dev ${interface} \
+- ${if_metric:+metric $if_metric} >/dev/null 2>&1
+-
+- if [ -n "$if_metric" ]; then
+- if_metric=$((if_metric+1))
+- fi
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ for router in $new_routers; do
++ if [ "$new_subnet_mask" = "255.255.255.255" ]; then
++ # point-to-point connection => set explicit route
++ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
++ fi
++
++ # set default route
++ ${ip} -4 route add default via ${router} dev ${interface} \
++ ${if_metric:+metric $if_metric} >/dev/null 2>&1
++
++ if [ -n "$if_metric" ]; then
++ if_metric=$((if_metric+1))
++ fi
++ done
++ fi
+ fi
+ fi
+
+@@ -330,15 +332,17 @@
+ if_metric=${if_metric:-1}
+ fi
+
+- # set default route
+- for router in $new_routers; do
+- ${ip} -4 route add default via ${router} dev ${interface} \
+- ${if_metric:+metric $if_metric} >/dev/null 2>&1
+-
+- if [ -n "$if_metric" ]; then
+- if_metric=$((if_metric+1))
+- fi
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ # set default route
++ for router in $new_routers; do
++ ${ip} -4 route add default via ${router} dev ${interface} \
++ ${if_metric:+metric $if_metric} >/dev/null 2>&1
++
++ if [ -n "$if_metric" ]; then
++ if_metric=$((if_metric+1))
++ fi
++ done
++ fi
+ fi
+
+ # update /etc/resolv.conf
diff --git a/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch b/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch
new file mode 100644
index 000000000000..3efb6459ebf9
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.6-quieter-ping.patch
@@ -0,0 +1,66 @@
+--- dhcp-4.3.6/client/scripts/bsdos
++++ dhcp-4.3.6/client/scripts/bsdos
+@@ -220,7 +220,7 @@
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/freebsd
++++ dhcp-4.3.6/client/scripts/freebsd
+@@ -287,7 +287,7 @@
+ if [ -n "$new_routers" ]; then
+ $LOGGER "New Routers: $new_routers"
+ set -- $new_routers
+- if ping -q -c 1 $1; then
++ if ping -q -c 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/linux
++++ dhcp-4.3.6/client/scripts/linux
+@@ -311,7 +311,7 @@
+ fi
+
+ # if there is no router recorded in the lease or the 1st router answers pings
+- if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}"; then
++ if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}" >/dev/null; then
+ # if we have $new_rfc3442_classless_static_routes then we have to
+ # ignore $new_routers entirely
+ if [ ! "$new_rfc3442_classless_static_routes" ]; then
+--- dhcp-4.3.6/client/scripts/netbsd
++++ dhcp-4.3.6/client/scripts/netbsd
+@@ -220,7 +220,7 @@
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/openbsd
++++ dhcp-4.3.6/client/scripts/openbsd
+@@ -214,7 +214,7 @@
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- dhcp-4.3.6/client/scripts/openwrt
++++ dhcp-4.3.6/client/scripts/openwrt
+@@ -190,7 +190,7 @@
+ ifconfig $interface $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg
+ set $new_routers
+- if ping -q -c 1 $1; then
++ if ping -q -c 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
diff --git a/net-misc/dhcp/files/dhcpd.conf2 b/net-misc/dhcp/files/dhcpd.conf2
new file mode 100644
index 000000000000..5cd2eeca3f71
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd.conf2
@@ -0,0 +1,28 @@
+# /etc/conf.d/dhcpd: config file for /etc/init.d/dhcpd
+
+# If you require more than one instance of dhcpd you can create symbolic
+# links to dhcpd service like so
+# cd /etc/init.d
+# ln -s dhcpd dhcpd.foo
+# cd ../conf.d
+# cp dhcpd dhcpd.foo
+# Now you can edit dhcpd.foo and specify a different configuration file.
+# You'll also need to specify a pidfile in that dhcpd.conf file.
+# See the pid-file-name option in the dhcpd.conf man page for details.
+
+# If you wish to run dhcpd in a chroot, uncomment the following line
+# DHCPD_CHROOT="/var/lib/dhcp/chroot"
+
+# All file paths below are relative to the chroot.
+# You can specify a different chroot directory but MAKE SURE it's empty.
+
+# Specify a configuration file - the default is /etc/dhcp/dhcpd.conf
+# DHCPD_CONF="/etc/dhcp/dhcpd.conf"
+
+# Configure which interface or interfaces to for dhcpd to listen on.
+# List all interfaces space separated. If this is not specified then
+# we listen on all interfaces.
+# DHCPD_IFACE=""
+
+# Insert any other dhcpd options - see the man page for a full list.
+# DHCPD_OPTS=""
diff --git a/net-misc/dhcp/files/dhcpd.init5 b/net-misc/dhcp/files/dhcpd.init5
new file mode 100644
index 000000000000..f0ea9b0c7904
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd.init5
@@ -0,0 +1,119 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="configtest"
+
+: ${DHCPD_CONF:=/etc/dhcp/${SVCNAME}.conf}
+
+depend() {
+ need net
+ use logger dns #@slapd@
+}
+
+get_var() {
+ local var="$(sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' "${chroot}${DHCPD_CONF}")"
+ echo ${var:-$2}
+}
+
+setup_opts() {
+ DHCPD_CHROOT=${DHCPD_CHROOT%/}
+
+ # Work out our cffile if it's in our DHCPD_OPTS
+ case " ${DHCPD_OPTS} " in
+ *" -cf "*)
+ DHCPD_CONF=" ${DHCPD_OPTS} "
+ DHCPD_CONF="${DHCPD_CONF##* -cf }"
+ DHCPD_CONF="${DHCPD_CONF%% *}"
+ ;;
+ *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}"
+ ;;
+ esac
+}
+
+checkconfig() {
+ set -- ${DHCPD_OPTS} -chroot "${DHCPD_CHROOT:-/}" -t
+
+ dhcpd "$@" 1>/dev/null 2>&1
+ local ret=$?
+ if [ ${ret} -ne 0 ] ; then
+ eerror "${SVCNAME} has detected a syntax error in your configuration files:"
+ dhcpd "$@"
+ fi
+
+ return ${ret}
+}
+
+configtest() {
+ setup_opts
+
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+start() {
+ setup_opts
+ local chroot="${DHCPD_CHROOT}"
+
+ if [ -n "${chroot}" ] ; then
+ # the config test want's these to exist
+ mkdir -p \
+ "${chroot}"/var/run/dhcp \
+ "${chroot}"/var/lib/dhcp \
+ "${chroot}"/etc/dhcp
+ fi
+
+ # see comment in get_var() above
+ if [ ! -f "${chroot}${DHCPD_CONF}" ] ; then
+ eerror "${chroot}${DHCPD_CONF} does not exist"
+ return 1
+ fi
+
+ checkconfig || return 1
+
+ checkpath -d -o dhcp:dhcp "${chroot}"/var/run/dhcp "${chroot}"/var/lib/dhcp
+
+ 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
+ fi
+
+ local pidfile="$(get_var pid-file-name /var/run/dhcp/${SVCNAME}.pid)"
+
+ ebegin "Starting ${chroot:+chrooted }${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/dhcpd \
+ --pidfile "${chroot}/${pidfile}" \
+ -- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \
+ -user dhcp -group dhcp \
+ -chroot "${chroot:-/}" ${DHCPD_IFACE}
+ eend $? \
+ && save_options dhcpd_chroot "${chroot}" \
+ && save_options pidfile "${pidfile}"
+}
+
+stop() {
+ local chroot="$(get_options dhcpd_chroot)"
+ [ -z "${chroot}" ] && chroot="$(get_options chroot)"
+
+ ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/sbin/dhcpd \
+ --pidfile "${chroot}/$(get_options pidfile)"
+ res=$?
+
+ if [ ${res} -eq 0 ] && [ -n "${chroot}" ] ; then
+ if mountinfo -q "${chroot}/proc" ; then
+ umount "${chroot}/proc"
+ fi
+ fi
+
+ eend ${res}
+}
diff --git a/net-misc/dhcp/files/dhcpd.tmpfiles b/net-misc/dhcp/files/dhcpd.tmpfiles
new file mode 100644
index 000000000000..ee2f4deeaadf
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/dhcp/ 0755 dhcp dhcp
+f /var/lib/dhcp/dhcpd.leases 0644 dhcp dhcp \ No newline at end of file
diff --git a/net-misc/dhcp/files/dhcpd4.service b/net-misc/dhcp/files/dhcpd4.service
new file mode 100644
index 000000000000..b064bd9b57df
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd4.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=DHCPv4 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcp -group dhcp --no-pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcpd6.service b/net-misc/dhcp/files/dhcpd6.service
new file mode 100644
index 000000000000..603cacd8eb89
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd6.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=DHCPv6 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+ExecStart=/usr/sbin/dhcpd -f -s -6 -cf /etc/dhcp/dhcpd.conf -user dhcp -group dhcp --no-pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcrelay.conf b/net-misc/dhcp/files/dhcrelay.conf
new file mode 100644
index 000000000000..44699682d42d
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay.conf
@@ -0,0 +1,16 @@
+# /etc/conf.d/dhcrelay: config file for /etc/init.d/dhcrelay
+
+# Configure which interface or interfaces to for dhcrelay to listen on
+# and send to.
+# List all interfaces space separated. If this is not specified then
+# we use all interfaces.
+#IFACE=""
+# If you have split net interfaces, you might want to depend on them
+# explicitly here.
+#rc_need=$(printf 'net.%s ' ${IFACE})
+
+# Insert any other options needed. See dhcrelay(8) for details.
+#DHCRELAY_OPTS=""
+
+# Space separated list of IPs to forward BOOTP/DHCP packets to.
+DHCRELAY_SERVERS=""
diff --git a/net-misc/dhcp/files/dhcrelay.init3 b/net-misc/dhcp/files/dhcrelay.init3
new file mode 100644
index 000000000000..a08ba8850740
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay.init3
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+ use logger #@slapd@
+}
+
+start() {
+ if [ -z "${DHCRELAY_SERVERS}" ] ; then
+ eerror "No DHCRELAY_SERVERS specified in /etc/conf.d/${SVCNAME}"
+ return 1
+ fi
+
+ checkpath -d /var/run/dhcp
+
+ local iface_opts
+ if [ -n "${IFACE}" ] ; then
+ iface_opts=$(printf -- '-i %s ' ${IFACE})
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/dhcrelay \
+ -- -q ${iface_opts} ${DHCRELAY_OPTS} ${DHCRELAY_SERVERS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile /var/run/dhcp/${SVCNAME}.pid
+ eend $?
+}
diff --git a/net-misc/dhcp/files/dhcrelay4.service b/net-misc/dhcp/files/dhcrelay4.service
new file mode 100644
index 000000000000..09e835d43357
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay4.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+Documentation=man:dhcrelay(8)
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/dhcrelay -d --no-pid $DHCRELAY_SERVERS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcrelay4.service.conf b/net-misc/dhcp/files/dhcrelay4.service.conf
new file mode 100644
index 000000000000..1a0465b767d6
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay4.service.conf
@@ -0,0 +1,3 @@
+# Space separated list of IPs to forward BOOTP/DHCP packets to.
+[Service]
+Environment="DHCRELAY_SERVERS=" \ No newline at end of file
diff --git a/net-misc/dhcp/files/dhcrelay6.conf b/net-misc/dhcp/files/dhcrelay6.conf
new file mode 100644
index 000000000000..4e8b8c6fea39
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay6.conf
@@ -0,0 +1,8 @@
+# /etc/conf.d/dhcrelay6: config file for /etc/init.d/dhcrelay6
+
+# Insert any other options needed. See dhcrelay(8) for details.
+# Make sure you specify the lower (-l)/upper (-u) interfaces.
+DHCRELAY_OPTS="-6 -l lower-iface -u upper-iface"
+
+# Space separated list of IPs to forward BOOTP/DHCP packets to.
+DHCRELAY_SERVERS=""
diff --git a/net-misc/dhcp/files/dhcrelay6.service b/net-misc/dhcp/files/dhcrelay6.service
new file mode 100644
index 000000000000..1e5e49888d61
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay6.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+Documentation=man:dhcrelay(8)
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/dhcrelay -d --no-pid -6 -l $lower-iface -u $upper-iface $DHCRELAY_SERVERS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcrelay6.service.conf b/net-misc/dhcp/files/dhcrelay6.service.conf
new file mode 100644
index 000000000000..ae293ab4ff28
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay6.service.conf
@@ -0,0 +1,6 @@
+[Service]
+# Space separated list of IPs to forward BOOTP/DHCP packets to
+Environment="DHCRELAY_SERVERS="
+# Make sure you specify the lower (-l)/upper (-u) interfaces
+Environment="lower-iface="
+Environment="upper-iface="
diff --git a/net-misc/dhcp/metadata.xml b/net-misc/dhcp/metadata.xml
new file mode 100644
index 000000000000..ec94f20ac1f1
--- /dev/null
+++ b/net-misc/dhcp/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <longdescription lang="en">The ISC DHCP client/server package.</longdescription>
+ <longdescription lang="ja">ISC DHCP クライアント/サーバ・パッケージです。</longdescription>
+ <use>
+ <flag name="client">Install the dhclient program</flag>
+ <flag name="server">Install the dhcpd and dhcrelay programs</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:isc:dhcp</remote-id>
+ </upstream>
+</pkgmetadata>