summaryrefslogtreecommitdiff
path: root/net-firewall/ipset
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-firewall/ipset
reinit the tree, so we can have metadata
Diffstat (limited to 'net-firewall/ipset')
-rw-r--r--net-firewall/ipset/Manifest29
-rw-r--r--net-firewall/ipset/files/ipset.confd16
-rw-r--r--net-firewall/ipset/files/ipset.initd-r259
-rw-r--r--net-firewall/ipset/files/ipset.initd-r395
-rw-r--r--net-firewall/ipset/files/ipset.initd-r495
-rw-r--r--net-firewall/ipset/ipset-6.15.ebuild111
-rw-r--r--net-firewall/ipset/ipset-6.16.1.ebuild110
-rw-r--r--net-firewall/ipset/ipset-6.16.ebuild110
-rw-r--r--net-firewall/ipset/ipset-6.17.ebuild110
-rw-r--r--net-firewall/ipset/ipset-6.19.ebuild110
-rw-r--r--net-firewall/ipset/ipset-6.20.1.ebuild113
-rw-r--r--net-firewall/ipset/ipset-6.21.1.ebuild113
-rw-r--r--net-firewall/ipset/ipset-6.24.ebuild98
-rw-r--r--net-firewall/ipset/ipset-6.29.ebuild98
-rw-r--r--net-firewall/ipset/ipset-6.30.ebuild97
-rw-r--r--net-firewall/ipset/ipset-6.32.ebuild97
-rw-r--r--net-firewall/ipset/metadata.xml7
17 files changed, 1468 insertions, 0 deletions
diff --git a/net-firewall/ipset/Manifest b/net-firewall/ipset/Manifest
new file mode 100644
index 000000000000..71e280d5517b
--- /dev/null
+++ b/net-firewall/ipset/Manifest
@@ -0,0 +1,29 @@
+AUX ipset.confd 588 SHA256 a4203705531190ba1793dfe18e0cad03cae624918fdd9845d79c6aef27ad6ee7 SHA512 93e01873c3fb8ff5f4f78e04118a666a650e604a1ba2908309faab08aa140e0ca7a2e24fc5114a9e809d3dbe81e801fc9ad59d53e174014cae1f23719a2a8e3e WHIRLPOOL a1ff1c60d761de759ca9c624784698dfb18e461eb2eb817eadbeeadf0706f8af07d1dc36c495435f338c6aa099a2b974e4c9c10179a4fc98eb11c15dc8fcc23b
+AUX ipset.initd-r2 1342 SHA256 15dc2018baf45fb5bb6778815545730039ab6a0e3d07b9fe1b2afa70fa51c58c SHA512 0de7ca42ebc8edcc3463bd532cdddaba000aa91f92173ebc5b4bf7b4b182602ce586f40726fc8cd0156b55e25bcec96372b84aae2e655b15013bcd861757e4f4 WHIRLPOOL 017a867e9bf9e0284b997a5ba188d74f9e672a7fe5ad54f3c4284ded0655a99edaafef71b39f9c24e140e93e1f1e4428fe58a86acdc37d1b6bfce48234903f9f
+AUX ipset.initd-r3 2985 SHA256 78d8c31c00d746552db9fdee77effd508c20389d1ee229e9ebd1f4b8d1273e6e SHA512 254b09865fad6d8d88af77a7264d14dc341946e768b4f85fbe66e01dc4de0a3fae55f93b03c9cdc350779d5bb05710682acb5b9eb687b4cc6eeefb98933bdaac WHIRLPOOL 792030567faeaed77196a4f9c87df9ba36bfe9848bc33049e2e63cf2dbaa4a405626152e2a74901a7bc969b4db09ec0aa3fa68489adf738ba14de7d013af9594
+AUX ipset.initd-r4 3005 SHA256 431663ee4a0d1ae8f8574edce310f9fe2e9c9c649fb89f4081362bc523143a5e SHA512 1d5e0a56811bbd11193712bf6ab165ce43426cd46cefe17e06598e905ff3a4902f4eca723b40ba3962fa344fdefb0a5df6b6d70b7b8fb40b376441975634a211 WHIRLPOOL 061dcfe62f6465ec16219bde3065023446c35775a3e6c35fd342b67d19cadc29ddcff460a88286f66d292c9412a07aa94b6807d1f1a3a9573cce266ad7cd5d55
+DIST ipset-6.15.tar.bz2 432771 SHA256 6f60a472bc2ef7b1c864be6472de65365c90e264dfadf28da48c2361393d8fd1 SHA512 f72329bb8610717ccdddbfaf7b7774e717a34d71fdb7f9c7eac97e3d1b314915500c88137b6e229411df99c86d2228bef447f26c116bc2cf992cfb60ab1422d3 WHIRLPOOL 868ee3cd722c2d86c273aca8f3ca7695e8ef5d00d30111ef0f2bf972a119211008d8cadec1760b43b4f0efb24690f20a2cf5f0fdbbb0700cf66e5660d363ab2a
+DIST ipset-6.16.1.tar.bz2 433347 SHA256 cb5b02deab8521946fd473b77c40f00452b76fed621f0eee76746c74e89e4c3c SHA512 e54d32932875a9d06acba598280de9e83529f36326cbaaeb05d38b985bc40d276dc46e37eae3d1d4c1afcdd69b3074678512349ebd964b6189ca1c6871efe304 WHIRLPOOL ff2276446c7dbb4005de236b73bf9879ead8273f3ec014883160b779f6c089eaf7d4c4dce06233ef357f0a8b5376754b158eec29187ae5f5f7bb52bfd2d8ae3c
+DIST ipset-6.16.tar.bz2 433118 SHA256 bc3ea05cfbacd43aebff6668825453d0a626edd5d3495a8670103ab895fba464 SHA512 34ef44af76f3609035ae1bdacb7586f2288ee66701ed8a1a5a0632fb23b5f651fe02b070e0f0f1b0ebae6cab02b3f827cc7e67f740cf77f51ba494c25dcc47dd WHIRLPOOL 3b3c2172626530145401bd813c39114f31bf3546ebe0af6e168ed32ade102c158f3bc5f4690ee8bf0540415adc35929da5d8ca8e4e1c2ec83bf631849a24b8a7
+DIST ipset-6.17.tar.bz2 448076 SHA256 7987bb8de1b0490b32084ab72165ae53038e497a96ab9940920280d8068629b0 SHA512 668f173b7ddd8a18af2730205e2e2c38610aa9fd191af52f91080e903bcd8e1f38e8e3a7fd57077decb00fd0556df89c3315c91eaffaa6977f2caf2a3300b175 WHIRLPOOL 1d08c841d87c7a5ca355857ac823ee696922b867690e9066c631414615c98f3cf3e59c6dd8d9f556170eef90a029260c7d41dc1e3f47811ede2190c5d0298e8b
+DIST ipset-6.19.tar.bz2 465927 SHA256 058e7950efdf8b9539ab79eb145de7be60d6cb7b92c0c011edda37e70135024c SHA512 9e9fdccd8ae34ad56c5fc6da03060b39b3acc9a53154acf7e82df3f2c1545b2bdcc7b5b9b4f6ddd6ee3e8582e81b1fa51fae37cb4f46948c053d5153bdca6f39 WHIRLPOOL 31472a732781598c8d99ee562766492c225e359b8153ff68a7769d8fa86f41cac9749eda08e4e3922a6ada5a815192109104b42c59ba3079530f6c0b0169613c
+DIST ipset-6.20.1.tar.bz2 500898 SHA256 356cac020438cd0871acbfc4cb119b8296030f0bb4661ad0d44bbc115ccbce92 SHA512 3fda3a71c18c8d5f9567038fc72f95abec81b4c789fbca7f7b9c032b15000cfbd2829f11a07f2f9ad2afcff54d6851923caff0917b2ead73756673a6b3667565 WHIRLPOOL f31cd533d286238e63f38aecbf281d428d75e856b393f61db5f6622d0dc0cd0a6de7aa4d3eaa2831e1da7dd0846e95c22f92b3a586cf3918cee074360a4caff3
+DIST ipset-6.21.1.tar.bz2 510013 SHA256 cf46c9c35a15aa0f2e0fbab0422586757bd82386c8ad3864936e6cffbd74a331 SHA512 c2ffb2eafc780e15370fd48841f4323c39e8fef1893216c8bc0b8aa8d143f9daf078c6e261e4558243004fe9612ce1d5ca4cca16f8b3f324f4194700c1b0accb WHIRLPOOL 230ebb4756891283980f5b7f67c0c64772b1527b8e8c0b6cdd2714de450b3f6c2a75d961d44563e440edd1399bdee8cce820fe59f46c28355a6f053ad6b1c37b
+DIST ipset-6.24.tar.bz2 518811 SHA256 3071fc283f00a6472b5b352ef57f9825c9face70dda5b0d8715f8d43d0e995d0 SHA512 107bf492030dc4e8e4c2a939e46a715f58458126bfb636dae993e5bf31151d33c2a41b89eb5cca85b71d95b3e36debf97cdfc72c568f351091df17159003d6c6 WHIRLPOOL d34e8d5d197be85cf00ea6a5dbfeb7c52b5d42d9e78299620928e69ba1fbbe124cb16b9f5f2e05d1213b2b7a29a2bed2c1edac2f15ee3c83d8dc19eb3afcc112
+DIST ipset-6.29.tar.bz2 542735 SHA256 6af58b21c8b475b1058e02529ea9f15b4b727dbc13dc9cbddf89941b0103880e SHA512 ce62c72c4cea1b52f069602a90fbffe9bcb12bf70f5b42d93cacb48e4b5d1192a13b18be45391c66a65421f41968e73416e16af25ae6ef19ba92bdbb2cd45ff3 WHIRLPOOL 8e6642d180b5e682bb121ffc249638da27650f97bc3b1e8aef75996d7c626eb447c9324b9cf68e25773cef73720e6281c7a16bf3ba96433ab77ef6f437be3999
+DIST ipset-6.30.tar.bz2 544054 SHA256 65bfa43fec3d51a6b4012f3d7e4b93a748df9b71b6cd6c53adbec8083e804a31 SHA512 6299a6905fbbcc2dd7c2f07862af184fd3b63b586f7bf3af2de5a0cc692f4ec6ef57db64c3435c1acedd6c293570602dca8cfedcb197a00ec18517ced92dc903 WHIRLPOOL d7721b40c5a1556928778fe8adec6c792d0f281737b61680ab414e4aa11691dc2f9c0bf0e56ec8873f4263011e836963d1ab2e273b206b7a0a98adc2ea3d5468
+DIST ipset-6.32.tar.bz2 544635 SHA256 d9cbb49a4ae9e32d7808a604f1a37f359f9fc9064c210c4c5f35d629d49fb9fe SHA512 7b0f5e7ef1a777ab70872aa52f658ff9516cb5de4c67c56d7f596eb88db03467d39b10ffc098441b4bfa4bb21a15f3c5f7f7f825300ce8efbacd767369ad43c7 WHIRLPOOL a87a94f617b269cfcdb3dbf1516d1902b027f82fdec8b1e1d7586c83e1582256f61383be70c7bc5c96959bd0677d290db6a114d03dd2b83108f418a7f843dc99
+EBUILD ipset-6.15.ebuild 3234 SHA256 7d5b60e417a6161c1f23dc4ffe37249a00118b597fb30f1da07ff38c5a35d5bf SHA512 6ff43aa71c0db6bd657335ee29578a9f243cec4e0f1e92183380e619e2cae72801fbba56f109465aeb15fdb513bf7e20f6eb908dd5610b11eb5850b1658864cc WHIRLPOOL ea3b226388f573c60cf2884ae5ecb52d4035f017681ea205647bee926305a1e2c8975381e7f021f9649b3a52bc433c1b591dc72d145795b0ad728e09db8b48ff
+EBUILD ipset-6.16.1.ebuild 3209 SHA256 154b2af5f88fdf0b113e067b5f4915f0a021801ee0968d5c26e4829dac0a4a94 SHA512 f920cbccf52b57fc82b51687145d7e5866ba8e3e96db0a61b7838a3f1e38f4909447f9c9cc6a1caf518467200b043db35ec7d4a61bf91b683e4b5832edc280ea WHIRLPOOL 9941bf8ad948777a130da79aa83ae4dd0141f10a6a90bc998f871dc19cf9d12ef834d19498b764cc0cbcc1da0d9da00fe2fb174ac6d2d57119fb5a22f84a8a8f
+EBUILD ipset-6.16.ebuild 3209 SHA256 154b2af5f88fdf0b113e067b5f4915f0a021801ee0968d5c26e4829dac0a4a94 SHA512 f920cbccf52b57fc82b51687145d7e5866ba8e3e96db0a61b7838a3f1e38f4909447f9c9cc6a1caf518467200b043db35ec7d4a61bf91b683e4b5832edc280ea WHIRLPOOL 9941bf8ad948777a130da79aa83ae4dd0141f10a6a90bc998f871dc19cf9d12ef834d19498b764cc0cbcc1da0d9da00fe2fb174ac6d2d57119fb5a22f84a8a8f
+EBUILD ipset-6.17.ebuild 3207 SHA256 abf1dfd2a254c641a34ca39d227efc81cfa24993371c5c9f53e17e2787ed8ad0 SHA512 22de0e3a9879176f7ac54f7bedf52699f3ac109f1fadc999411372de9118fb4c0f045fafc256ae07a909dd6946af04fca1c6b412ef7fcddf61a358fe1c61f888 WHIRLPOOL 2a264d6e74024b20fce3f92d4bd69d62863f99ddfa1ad25045f90c2f07c9e0177003a29c932592c3c3498dfdd15da63613bf007267a2b29da67987285daba58e
+EBUILD ipset-6.19.ebuild 3209 SHA256 154b2af5f88fdf0b113e067b5f4915f0a021801ee0968d5c26e4829dac0a4a94 SHA512 f920cbccf52b57fc82b51687145d7e5866ba8e3e96db0a61b7838a3f1e38f4909447f9c9cc6a1caf518467200b043db35ec7d4a61bf91b683e4b5832edc280ea WHIRLPOOL 9941bf8ad948777a130da79aa83ae4dd0141f10a6a90bc998f871dc19cf9d12ef834d19498b764cc0cbcc1da0d9da00fe2fb174ac6d2d57119fb5a22f84a8a8f
+EBUILD ipset-6.20.1.ebuild 3423 SHA256 6900475b6a6a1e3a1a66d55eb574bbe0d93456c1faa7856a9cfbcbcb798da3cc SHA512 8eca0e5209f03e7b69374b568ef9db4c79267b689de95e0089c39dbd77510ad61eb400a58c16b6c4905e2ab945e799bd940f51feda0588192bad7b72a2f3cd3c WHIRLPOOL d6c73ed70a93ea091ce33e86042cb710b5128d365eb76abf646327512166b10bf1dbf4b9ca3b0096547f74feee9f6cb94f883239696f58a1c1e34c932eb88f88
+EBUILD ipset-6.21.1.ebuild 3424 SHA256 3a6b8b62fe216ee7dec1577a05a0ce30baa4c0a82c5a9157d85289e06e74cbc7 SHA512 4fb0e425af02f7080275c155f7f3b04cec7179e663664accb118f7c4c0cc6415487546a03934773b7e1df0090bfcf422a335f5c7f415b389d78e51f0f7ba6227 WHIRLPOOL e4e00d322e0d13e664f90512d4cf7d1b011cccce8b2405652b27ed41c1b1ff43430eb99ce6e33eff886709b15b9edb541c02f52b5f3921980330c16bec1cdacd
+EBUILD ipset-6.24.ebuild 2963 SHA256 fb91f18a7d4fd218523af476a8f1a166fa73133f3be931371bdac31f253337d0 SHA512 1ee2bc5442dc5c10bb29b53984a7cd84bafc9618a61fdb633bf435e65c06e77cb0036a6752a3e8078b0b31a848843ad6961a607d147c09eb945d63efd2d56978 WHIRLPOOL 955aab838c43c723febf4cccbb1177d1dcda18db071595f7675e6f467ce73c692a79aa8656b0a4d5e409cbc35f1b9cd85b69bde97ee2969df0f06ae6fbebde4d
+EBUILD ipset-6.29.ebuild 2961 SHA256 14ba10b0bb9f715466e2040ed95e88ffab3eb6571c84d571a9ef29725dadd9a9 SHA512 c11c5a7b9c56b00d1ae60328d31c6415238b680329d2d1b7be591cd0d6c383029fe07e4305e6bb6e2780205bc4525c2f39bb106a6d3a8c542cf4ea8c00839ccd WHIRLPOOL 16872bdedc995113b2de12de45a13e172ccdee8c345a439ff8938aeb7d2fe08cef4521687fd01ffc37e10aec016402c0fe5dc1ac0e28d4d6a3dbb80e09c035c6
+EBUILD ipset-6.30.ebuild 2888 SHA256 452ea909dbae7e471557089df633f3ec05ca9736d2d14f952a691ba4503c61f5 SHA512 abd9526b8b6576ed497a8679a903b34fe7330343b91c925bebb2be9a2efaea32472384ed3a6b74cb7b59ddcac5bd865594690597492c78853895f2afc5197efd WHIRLPOOL 57c840c60113427a0a48f785a596841b0c64aefd6205e26d3cb4417118975433f9608d888571a8ed8e4a351d8158048692a6eccb9251e94551efd772e8ed2d48
+EBUILD ipset-6.32.ebuild 2888 SHA256 452ea909dbae7e471557089df633f3ec05ca9736d2d14f952a691ba4503c61f5 SHA512 abd9526b8b6576ed497a8679a903b34fe7330343b91c925bebb2be9a2efaea32472384ed3a6b74cb7b59ddcac5bd865594690597492c78853895f2afc5197efd WHIRLPOOL 57c840c60113427a0a48f785a596841b0c64aefd6205e26d3cb4417118975433f9608d888571a8ed8e4a351d8158048692a6eccb9251e94551efd772e8ed2d48
+MISC ChangeLog 3403 SHA256 d9b2e40acbe8a994282ab13ec91d59ee8a34c5c8676f7916c6f12be01c38b954 SHA512 48025aab367377691b05ca7cc02498e7e4f242c15fbb8314a6ba09f4a93f0f917c8c6a8273efc0fa2571942fe506672bc44cf4fb444eead88c6477a35ac4b4bd WHIRLPOOL 64f8412d7634471daabd72a61dd53bbfeaf9243a4db35764680330ad01307e3ad66cfd314b7eda557caf8535e372331edf7c96119282776742ab1e2d0c52d2c9
+MISC ChangeLog-2015 13758 SHA256 27fcbac08b65bff92d005acff99837b659b9d5b4e35b8caff074bc806c391944 SHA512 16a2bb6094b0934630108bb336838887457672f74c374316ff5450ee8af8e94432661d85c879b233f16ce751fc3d2abf86888d920d588bbfefbb7b1504f8fba1 WHIRLPOOL d2f52c40acc89740fd22475cd55c92062dc749601fb02cc813d82ac1b8369c33df8f4d0a26d1505ef78715ca7c3f08e491cbcf673be8e7b8ac4a813c203e198a
+MISC metadata.xml 216 SHA256 f7475919f28a8a93ec8bd025c8f8bbab918f66d0d1737420c876f0480308fe6a SHA512 e881b59fe49746eb25ad66c258b41aba501e4eb563129093a3898ea970a20506e7898f7c355cfcf99605234962bf2c77c1309c258b9a2b84ee4302ccb71c9dbd WHIRLPOOL 163285b60aa93e00993af659dc1e29a9eb245bd3415dd5ec75b284250596165f469028102b72fa0c344834443a44c1bbcf6272fe6a3f5211f721fc96e1c6ec16
diff --git a/net-firewall/ipset/files/ipset.confd b/net-firewall/ipset/files/ipset.confd
new file mode 100644
index 000000000000..9fe42e9c75c5
--- /dev/null
+++ b/net-firewall/ipset/files/ipset.confd
@@ -0,0 +1,16 @@
+# /etc/conf.d/ipset
+
+# Location in which ipset initscript will save set rules on
+# service shutdown
+IPSET_SAVE="/var/lib/ipset/rules-save"
+
+# Save state on stopping ipset
+SAVE_ON_STOP="yes"
+
+# If you need to log iptables messages as soon as iptables starts,
+# AND your logger does NOT depend on the network, then you may wish
+# to uncomment the next line.
+# If your logger depends on the network, and you uncomment this line
+# you will create an unresolvable circular dependency during startup.
+# After commenting or uncommenting this line, you must run 'rc-update -u'.
+#rc_use="logger"
diff --git a/net-firewall/ipset/files/ipset.initd-r2 b/net-firewall/ipset/files/ipset.initd-r2
new file mode 100644
index 000000000000..86c580cfe086
--- /dev/null
+++ b/net-firewall/ipset/files/ipset.initd-r2
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="save"
+
+IPSET_SAVE=${IPSET_SAVE:-/var/lib/ipset/rules-save}
+
+depend() {
+ before iptables ip6tables
+}
+
+checkconfig() {
+ if [ ! -f "${IPSET_SAVE}" ] ; then
+ eerror "Not starting ${SVCNAME}. First create some rules then run:"
+ eerror "/etc/init.d/${SVCNAME} save"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Loading ipset session"
+ ipset restore < "${IPSET_SAVE}"
+ eend $?
+}
+
+stop() {
+ # check if there are any references to current sets
+
+ if ! ipset list | gawk '
+ ($1 == "References:") { refcnt += $2 }
+ ($1 == "Type:" && $2 == "list:set") { set = 1 }
+ (scan) { if ($0 != "") setcnt++; else { scan = 0; set = 0 } }
+ (set && $1 == "Members:") {scan = 1}
+ END { if ((refcnt - setcnt) > 0) exit 1 }
+ '; then
+ eerror "ipset is in use, can't stop"
+ return 1
+ fi
+
+ if [ "${SAVE_ON_STOP}" = "yes" ] ; then
+ save || return 1
+ fi
+
+ ebegin "Removing kernel IP sets"
+ ipset flush
+ ipset destroy
+ eend $?
+}
+
+save() {
+ ebegin "Saving ipset session"
+ touch "${IPSET_SAVE}"
+ chmod 0600 "${IPSET_SAVE}"
+ ipset save > "${IPSET_SAVE}"
+ eend $?
+}
diff --git a/net-firewall/ipset/files/ipset.initd-r3 b/net-firewall/ipset/files/ipset.initd-r3
new file mode 100644
index 000000000000..85556edd1c39
--- /dev/null
+++ b/net-firewall/ipset/files/ipset.initd-r3
@@ -0,0 +1,95 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="save"
+extra_started_commands="reload"
+
+IPSET_SAVE=${IPSET_SAVE:-/var/lib/ipset/rules-save}
+
+depend() {
+ before iptables ip6tables
+}
+
+checkconfig() {
+ if [ ! -f "${IPSET_SAVE}" ] ; then
+ eerror "Not starting ${SVCNAME}. First create some rules then run:"
+ eerror "/etc/init.d/${SVCNAME} save"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Loading ipset session"
+ ipset restore < "${IPSET_SAVE}"
+ eend $?
+}
+
+stop() {
+ # check if there are any references to current sets
+
+ if ! ipset list | gawk '
+ ($1 == "References:") { refcnt += $2 }
+ ($1 == "Type:" && $2 == "list:set") { set = 1 }
+ (scan) { if ($0 != "") setcnt++; else { scan = 0; set = 0 } }
+ (set && $1 == "Members:") {scan = 1}
+ END { if ((refcnt - setcnt) > 0) exit 1 }
+ '; then
+ eerror "ipset is in use, can't stop"
+ return 1
+ fi
+
+ if [ "${SAVE_ON_STOP}" = "yes" ] ; then
+ save || return 1
+ fi
+
+ ebegin "Removing kernel IP sets"
+ ipset flush
+ ipset destroy
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ipsets"
+
+ # Loading sets from a save file is only additive (there is no
+ # automatic flushing or replacing). And, we can not remove sets
+ # that are currently used in existing iptables rules.
+ #
+ # Instead, we create new temp sets for any set that is already
+ # in use, and then atomically swap them into place.
+ #
+ # XXX: This does not clean out previously used ipsets that are
+ # not in the new saved policy--it can't, because they may still
+ # be referenced in the current iptables rules.
+
+ # Build a list of all currently used sets (if any).
+ running_ipset_list=$(ipset save | gawk '/^create/{printf "%s ",$2}')
+ running_ipset_list="${running_ipset_list% }"
+ # Build a regular expression that matches those set names.
+ running_ipset_list_regex="${running_ipset_list// /|}"
+
+ # Load up sets from the save file, but rename any set that already
+ # exists to a temporary name that we will swap later.
+ if ! cat ${IPSET_SAVE} | sed -r "s/^(create|add) (${running_ipset_list_regex}) /\1 \2_atomic_temp /" | ipset restore ; then
+ eend $? "Failed to load new ipsets"
+ fi
+
+ # Now for every set name that currently exists, atomically swap it
+ # with the temporary new one we created, and then destroy the old set.
+ for ipset_name in ${running_ipset_list} ; do
+ ipset swap ${ipset_name} ${ipset_name}_atomic_temp || eend $? "Failed to swap in new ipset $ipset_name"
+ ipset destroy ${ipset_name}_atomic_temp || eend $? "Failed to delete obsolete ipset ${ipset_name}_atomic_temp"
+ done
+ eend 0
+}
+
+save() {
+ ebegin "Saving ipset session"
+ touch "${IPSET_SAVE}"
+ chmod 0600 "${IPSET_SAVE}"
+ ipset save > "${IPSET_SAVE}"
+ eend $?
+}
diff --git a/net-firewall/ipset/files/ipset.initd-r4 b/net-firewall/ipset/files/ipset.initd-r4
new file mode 100644
index 000000000000..08edfcbcf859
--- /dev/null
+++ b/net-firewall/ipset/files/ipset.initd-r4
@@ -0,0 +1,95 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="save"
+extra_started_commands="reload"
+
+IPSET_SAVE=${IPSET_SAVE:-/var/lib/ipset/rules-save}
+
+depend() {
+ before iptables ip6tables
+}
+
+checkconfig() {
+ if [ ! -f "${IPSET_SAVE}" ] ; then
+ eerror "Not starting ${SVCNAME}. First create some rules then run:"
+ eerror "/etc/init.d/${SVCNAME} save"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Loading ipset session"
+ ipset restore < "${IPSET_SAVE}"
+ eend $?
+}
+
+stop() {
+ # check if there are any references to current sets
+
+ if ! ipset list | gawk '
+ ($1 == "References:") { refcnt += $2 }
+ ($1 == "Type:" && $2 == "list:set") { set = 1 }
+ (scan) { if ($0 != "") setcnt++; else { scan = 0; set = 0 } }
+ (set && $1 == "Members:") {scan = 1}
+ END { if ((refcnt - setcnt) > 0) exit 1 }
+ '; then
+ eerror "ipset is in use, can't stop"
+ return 1
+ fi
+
+ if [ "${SAVE_ON_STOP}" = "yes" ] ; then
+ save || return 1
+ fi
+
+ ebegin "Removing kernel IP sets"
+ ipset flush
+ ipset destroy
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ipsets"
+
+ # Loading sets from a save file is only additive (there is no
+ # automatic flushing or replacing). And, we can not remove sets
+ # that are currently used in existing iptables rules.
+ #
+ # Instead, we create new temp sets for any set that is already
+ # in use, and then atomically swap them into place.
+ #
+ # XXX: This does not clean out previously used ipsets that are
+ # not in the new saved policy--it can't, because they may still
+ # be referenced in the current iptables rules.
+
+ # Build a list of all currently used sets (if any).
+ running_ipset_list=$(ipset save | gawk '/^create/{printf "%s ",$2}')
+ running_ipset_list="${running_ipset_list% }"
+ # Build a regular expression that matches those set names.
+ running_ipset_list_regex="$(echo "$running_ipset_list" | tr -s ' ' '|' )"
+
+ # Load up sets from the save file, but rename any set that already
+ # exists to a temporary name that we will swap later.
+ if ! cat ${IPSET_SAVE} | sed -r "s/^(create|add) (${running_ipset_list_regex}) /\1 \2_atomic_temp /" | ipset restore ; then
+ eend $? "Failed to load new ipsets"
+ fi
+
+ # Now for every set name that currently exists, atomically swap it
+ # with the temporary new one we created, and then destroy the old set.
+ for ipset_name in ${running_ipset_list} ; do
+ ipset swap ${ipset_name} ${ipset_name}_atomic_temp || eend $? "Failed to swap in new ipset $ipset_name"
+ ipset destroy ${ipset_name}_atomic_temp || eend $? "Failed to delete obsolete ipset ${ipset_name}_atomic_temp"
+ done
+ eend 0
+}
+
+save() {
+ ebegin "Saving ipset session"
+ touch "${IPSET_SAVE}"
+ chmod 0600 "${IPSET_SAVE}"
+ ipset save > "${IPSET_SAVE}"
+ eend $?
+}
diff --git a/net-firewall/ipset/ipset-6.15.ebuild b/net-firewall/ipset/ipset-6.15.ebuild
new file mode 100644
index 000000000000..fda7f2ff30db
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.15.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+inherit autotools linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="modules"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net,net{port,iface}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+check_header_patch() {
+ if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
+ eerror "Sorry, but you have to patch kernel sources with the following patch:"
+ eerror " # cd ${KV_DIR}"
+ eerror " # patch -i ${S}/netlink.patch -p1"
+ eerror "You should recompile and run new kernel to avoid runtime errors."
+ die "Unpatched kernel"
+ fi
+}
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_prepare() {
+ [[ ${build_modules} -eq 1 ]] && check_header_patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}" \
+ --disable-silent-rules
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.16.1.ebuild b/net-firewall/ipset/ipset-6.16.1.ebuild
new file mode 100644
index 000000000000..735cbce7981a
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.16.1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit autotools linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="modules"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net,net{port,iface}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+check_header_patch() {
+ if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
+ eerror "Sorry, but you have to patch kernel sources with the following patch:"
+ eerror " # cd ${KV_DIR}"
+ eerror " # patch -i ${S}/netlink.patch -p1"
+ eerror "You should recompile and run new kernel to avoid runtime errors."
+ die "Unpatched kernel"
+ fi
+}
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_prepare() {
+ [[ ${build_modules} -eq 1 ]] && check_header_patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.16.ebuild b/net-firewall/ipset/ipset-6.16.ebuild
new file mode 100644
index 000000000000..735cbce7981a
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.16.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit autotools linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="modules"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net,net{port,iface}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+check_header_patch() {
+ if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
+ eerror "Sorry, but you have to patch kernel sources with the following patch:"
+ eerror " # cd ${KV_DIR}"
+ eerror " # patch -i ${S}/netlink.patch -p1"
+ eerror "You should recompile and run new kernel to avoid runtime errors."
+ die "Unpatched kernel"
+ fi
+}
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_prepare() {
+ [[ ${build_modules} -eq 1 ]] && check_header_patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.17.ebuild b/net-firewall/ipset/ipset-6.17.ebuild
new file mode 100644
index 000000000000..e841595369ff
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.17.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit autotools linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="modules"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net,net{port,iface}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+check_header_patch() {
+ if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
+ eerror "Sorry, but you have to patch kernel sources with the following patch:"
+ eerror " # cd ${KV_DIR}"
+ eerror " # patch -i ${S}/netlink.patch -p1"
+ eerror "You should recompile and run new kernel to avoid runtime errors."
+ die "Unpatched kernel"
+ fi
+}
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_prepare() {
+ [[ ${build_modules} -eq 1 ]] && check_header_patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.19.ebuild b/net-firewall/ipset/ipset-6.19.ebuild
new file mode 100644
index 000000000000..735cbce7981a
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.19.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit autotools linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="modules"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net,net{port,iface}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+check_header_patch() {
+ if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
+ eerror "Sorry, but you have to patch kernel sources with the following patch:"
+ eerror " # cd ${KV_DIR}"
+ eerror " # patch -i ${S}/netlink.patch -p1"
+ eerror "You should recompile and run new kernel to avoid runtime errors."
+ die "Unpatched kernel"
+ fi
+}
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_prepare() {
+ [[ ${build_modules} -eq 1 ]] && check_header_patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r2 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.20.1.ebuild b/net-firewall/ipset/ipset-6.20.1.ebuild
new file mode 100644
index 000000000000..6bd830949e02
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.20.1.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+MODULES_OPTIONAL_USE=modules
+inherit autotools linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~x86"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net{,port{,net},iface,net}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+check_header_patch() {
+ if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
+ eerror "Sorry, but you have to patch kernel sources with the following patch:"
+ eerror " # cd ${KV_DIR}"
+ eerror " # patch -i ${S}/netlink.patch -p1"
+ eerror "You should recompile and run new kernel to avoid runtime errors."
+ die "Unpatched kernel"
+ fi
+}
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+ # It does still build without NET_NS, but it may be needed in future.
+ #CONFIG_CHECK="${CONFIG_CHECK} NET_NS"
+ #ERROR_NET_NS="ipset requires NET_NS (network namespace) support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_prepare() {
+ [[ ${build_modules} -eq 1 ]] && check_header_patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.21.1.ebuild b/net-firewall/ipset/ipset-6.21.1.ebuild
new file mode 100644
index 000000000000..70888cbc868d
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.21.1.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+MODULES_OPTIONAL_USE=modules
+inherit autotools linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net{,port{,net},iface,net}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+check_header_patch() {
+ if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
+ eerror "Sorry, but you have to patch kernel sources with the following patch:"
+ eerror " # cd ${KV_DIR}"
+ eerror " # patch -i ${S}/netlink.patch -p1"
+ eerror "You should recompile and run new kernel to avoid runtime errors."
+ die "Unpatched kernel"
+ fi
+}
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+ # It does still build without NET_NS, but it may be needed in future.
+ #CONFIG_CHECK="${CONFIG_CHECK} NET_NS"
+ #ERROR_NET_NS="ipset requires NET_NS (network namespace) support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_prepare() {
+ [[ ${build_modules} -eq 1 ]] && check_header_patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.24.ebuild b/net-firewall/ipset/ipset-6.24.ebuild
new file mode 100644
index 000000000000..0795c0f13b41
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.24.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+MODULES_OPTIONAL_USE=modules
+inherit linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~x86"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net{,port{,net},iface,net}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+ # It does still build without NET_NS, but it may be needed in future.
+ #CONFIG_CHECK="${CONFIG_CHECK} NET_NS"
+ #ERROR_NET_NS="ipset requires NET_NS (network namespace) support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.29.ebuild b/net-firewall/ipset/ipset-6.29.ebuild
new file mode 100644
index 000000000000..bdac66a1547a
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.29.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+MODULES_OPTIONAL_USE=modules
+inherit linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 ~ppc x86"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net{,port{,net},iface,net}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+ # It does still build without NET_NS, but it may be needed in future.
+ #CONFIG_CHECK="${CONFIG_CHECK} NET_NS"
+ #ERROR_NET_NS="ipset requires NET_NS (network namespace) support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r4 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.30.ebuild b/net-firewall/ipset/ipset-6.30.ebuild
new file mode 100644
index 000000000000..292b40eb05d7
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.30.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MODULES_OPTIONAL_USE=modules
+inherit linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~x86"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net{,port{,net},iface,net}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+ # It does still build without NET_NS, but it may be needed in future.
+ #CONFIG_CHECK="${CONFIG_CHECK} NET_NS"
+ #ERROR_NET_NS="ipset requires NET_NS (network namespace) support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r4 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/ipset-6.32.ebuild b/net-firewall/ipset/ipset-6.32.ebuild
new file mode 100644
index 000000000000..292b40eb05d7
--- /dev/null
+++ b/net-firewall/ipset/ipset-6.32.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MODULES_OPTIONAL_USE=modules
+inherit linux-info linux-mod
+
+DESCRIPTION="IPset tool for iptables, successor to ippool"
+HOMEPAGE="http://ipset.netfilter.org/"
+SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~x86"
+
+RDEPEND=">=net-firewall/iptables-1.4.7
+ net-libs/libmnl"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog INSTALL README UPGRADE )
+
+# configurable from outside, e.g. /etc/portage/make.conf
+IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
+
+BUILD_TARGETS="modules"
+MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
+MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
+for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net{,port{,net},iface,net}},_list_set}; do
+ MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
+done
+
+pkg_setup() {
+ get_version
+ CONFIG_CHECK="NETFILTER"
+ ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
+ # It does still build without NET_NS, but it may be needed in future.
+ #CONFIG_CHECK="${CONFIG_CHECK} NET_NS"
+ #ERROR_NET_NS="ipset requires NET_NS (network namespace) support in your kernel."
+
+ build_modules=0
+ if use modules; then
+ if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
+ if linux_chkconfig_present "IP_NF_SET" || \
+ linux_chkconfig_present "IP_SET"; then #274577
+ eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
+ eerror "Please either build ipset with modules USE flag disabled"
+ eerror "or rebuild kernel without IP_SET support and make sure"
+ eerror "there is NO kernel ip_set* modules in /lib/modules/<your_kernel>/... ."
+ die "USE=modules and in-kernel ipset support detected."
+ else
+ einfo "Modular kernel detected. Gonna build kernel modules..."
+ build_modules=1
+ fi
+ else
+ eerror "Nonmodular kernel detected, but USE=modules. Either build"
+ eerror "modular kernel (without IP_SET) or disable USE=modules"
+ die "Nonmodular kernel detected, will not build kernel modules"
+ fi
+ fi
+ [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
+}
+
+src_configure() {
+ econf \
+ $(use_with modules kmod) \
+ --disable-static \
+ --with-maxsets=${IP_NF_SET_MAX} \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-ksource="${KV_DIR}" \
+ --with-kbuild="${KV_OUT_DIR}"
+}
+
+src_compile() {
+ einfo "Building userspace"
+ emake
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Building kernel modules"
+ set_arch_to_kernel
+ emake modules
+ fi
+}
+
+src_install() {
+ einfo "Installing userspace"
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/ipset.initd-r4 ${PN}
+ newconfd "${FILESDIR}"/ipset.confd ${PN}
+ keepdir /var/lib/ipset
+
+ if [[ ${build_modules} -eq 1 ]]; then
+ einfo "Installing kernel modules"
+ linux-mod_src_install
+ fi
+}
diff --git a/net-firewall/ipset/metadata.xml b/net-firewall/ipset/metadata.xml
new file mode 100644
index 000000000000..79d462e85571
--- /dev/null
+++ b/net-firewall/ipset/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+</pkgmetadata>