From 40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 28 Apr 2021 20:21:43 +0100 Subject: gentoo resync : 28.04.2021 --- net-misc/htbinit/Manifest | 14 +-- net-misc/htbinit/files/htb.init-v0.8.5_tos.patch | 4 +- net-misc/htbinit/files/htb.init_find_fix.patch | 4 +- net-misc/htbinit/files/htb_0.8.5_esfq.diff | 53 ---------- net-misc/htbinit/files/htb_0.8.5_esfq.patch | 53 ++++++++++ net-misc/htbinit/files/htb_0.8.5_ipv6.diff | 128 ----------------------- net-misc/htbinit/files/htb_0.8.5_ipv6.patch | 128 +++++++++++++++++++++++ net-misc/htbinit/files/prio_rule.patch | 4 +- net-misc/htbinit/files/timecheck_fix.patch | 4 +- net-misc/htbinit/htbinit-0.8.5-r7.ebuild | 40 ++++--- 10 files changed, 222 insertions(+), 210 deletions(-) delete mode 100644 net-misc/htbinit/files/htb_0.8.5_esfq.diff create mode 100644 net-misc/htbinit/files/htb_0.8.5_esfq.patch delete mode 100644 net-misc/htbinit/files/htb_0.8.5_ipv6.diff create mode 100644 net-misc/htbinit/files/htb_0.8.5_ipv6.patch (limited to 'net-misc/htbinit') diff --git a/net-misc/htbinit/Manifest b/net-misc/htbinit/Manifest index 9bd8abf0de29..4447d3748645 100644 --- a/net-misc/htbinit/Manifest +++ b/net-misc/htbinit/Manifest @@ -1,10 +1,10 @@ -AUX htb.init-v0.8.5_tos.patch 1656 BLAKE2B 28b8096b5d3fe07864932678a8969210dd492ca9b13717f1c09510b8ef1ea73a21a608af3d91854a95d8a8cc21062eb17d0354b23543726f0aa2b04963fd0675 SHA512 6b8c78cd75207d23b1786ddeff01ba96e45fdba575b51dcd9e96880518a3edc97604f2fb2ccf44243e697dbe86233d38a26be54db3981e93ca98e3bf95e9dd87 -AUX htb.init_find_fix.patch 1165 BLAKE2B 0fd10a7c714717cfe8029ee817e624772b9008b2a98b02fb5c75cb1d2362d73a5cea16a7db4a021ce3fcc223883f0eef485bb0968f52515e984e371c416a754e SHA512 dbca235aa92ac5b2486fe7a89a215c4e621965f72ce04336d2c04cc02f61f40ec5a92347c1515b6e1114d176ea29cf61d457d504bfcaccfbe149d20231145d07 -AUX htb_0.8.5_esfq.diff 1844 BLAKE2B 9d8d8461d954a9e38cd646f965b7d8853f1a6d176e8233d2eea42e15168d97917613fcdb4ca062eac58981edd3db76a1c9f6073831316f9b0c8b0cd09a1b1607 SHA512 ffef80a68b7e84b7c3758322bc58120fa67cd813c4a688f4f4483fdb0d8c1efb180e373b2b510d72c8f13945a0c6137fea005a70ffbb7ace12f4865b69db1bdd -AUX htb_0.8.5_ipv6.diff 4663 BLAKE2B 3df3659b0dc6975fec3e8e9506965797924da602b6a2e8e747776ebf810a7bc5c8a221756b4eb2eda6ea6a6338829fbc2e05bfc075d9b666e5cd06cb76e05f7b SHA512 3e1265d912e055fb2188945a46bd23a0798d04b8d3faf62344b11bd5e434cb7119098f095dc9b954dfae9b1e315e841df4dc0f47620500a884f7cbdf4d8c79c6 +AUX htb.init-v0.8.5_tos.patch 1583 BLAKE2B 794c51472cfe08c8d56023f0dcf1a75fbcd2f215a8dee56add23e19fd7e9861946eeb757110cde22ec7204a3566e82f1ea00f738e04fac4626b3588c5e7e6f3b SHA512 902bb6d157deb4161d67e6ca2317410ccb1f2c771debe5c631fc76c9dc20a6920554b2776104247050191a03ec18e7d57fa79e4df79b5c6e6d98061013cf0b61 +AUX htb.init_find_fix.patch 1092 BLAKE2B f94b0f133ccfbdd03902ed5629965670f7947cb6d75acb6879e25d037094b98d7b859f53e16ffcea2edfe8448f40726861e57c83c66fef1fe759d38d2af86c46 SHA512 babb5092fb52447067c7d9246dec4e3605bb4ef14a908ffcd69dc03161a8451b5e9e35621748780f03604c8406e218ea84c066f4aff3552586daa5d7ac28ee61 +AUX htb_0.8.5_esfq.patch 1771 BLAKE2B 8b82f373273cbcb4547cdec198134873c484dee373ad78b6e09bc802422fa20583c9dc69793ae17f81500f299fca9131a5755da52daaf191e33c024afc02aeb2 SHA512 193724a11662df0ee306936f98034e6537c76147bbbdeae3074c77a9abcd8fa42ef06ebc169b8abdae1fcb62295839e7d70d52216d0ca037b5b27bfe37411f78 +AUX htb_0.8.5_ipv6.patch 4590 BLAKE2B 04fbcf0bde55ce921a938bf70adcaebcec1fcb580f9171e711f244fae01a00f9ecca4c917106f3243762844ae8e2aaf226c484f04e4276dbd7e27e84f1bd9adc SHA512 e35e3d1cd5c79ff456dffd880339a37a963a631b5a42f1e9663f0331c7b01a44ba1ae4d0633abc6bed13419502b0afb15d6c601ca61aac51119864ab0a6f9adf AUX htbinit.rc 706 BLAKE2B af87c49783feaea896d91b84284a21d902ea1f6180a231815094c378a7d4c8db76ccef8e412134ad72c1affe44b3234313c40cade2fc16f414d86c14f745d391 SHA512 17ddfb3dcc2c0b069c3af3548b385cbb894364f7a0c1a37f612c45368d1241dda03fadd544663fe09e2b2c7f2a4c2286f10848fb0230eb520e204b63fb7a3b52 -AUX prio_rule.patch 636 BLAKE2B f936b559ddbc9833484985470c91aa106624222b5be1453bfd9d8ad1ddcc6441904e4cd80647e2fdcf0db66a4b8fad3a2c63c0ab9b089d2e76aeba9c3d32eabf SHA512 f56f054a3ae3770ad9f8de5d43a2f73c211f92db98bce067195b950c182443efee653205e1f86b18e17ba6096d1e574ea7c0a7cc0326a141f84a0cc6f80c8edf -AUX timecheck_fix.patch 1221 BLAKE2B e10986774c5de48081c70ffe92889e69923ee2f5d2ba9ab6be89fe3f21dfef958c698611462060fad5fba082a10bf0a2bca55dde52b8f64c4cc497b3d44164a7 SHA512 ece43ece3ef84865311f14e783434048604b6c9c55b174a95cdaa89dbbccd091044ab387aef887d5c67c14b448260ba6fbd849ea6e454c245ba2c7918cec650e +AUX prio_rule.patch 563 BLAKE2B 17fe3c20556baf52b70885d9ea1c889e420b2f78b0178b1e1b0a19a227754e89ad2940e30f4df069e7568473d79e5338dd017d8dbbd5bfe2d26e7274cd1e3182 SHA512 0b2b20a699bad9062890172e4289b28b1d9e17494bab11211f801791e71134c4001406ee491a30f8d8ebbdd34486e4317929c21d2e16588101c8b2eeadeb9745 +AUX timecheck_fix.patch 1148 BLAKE2B d24d45dd565cdd578d2f17f3b1e1c171472b8eea053fff199e9dac9486472ad5be55fb9c89dd1fb6cfecad4d171184997406a04f4e077d28829e7a221e034f4c SHA512 5e8583d004e15f6dde4ac37771e91683e46d2bb132b776002924508e3e6ca32b2e32bda471c20d0237f448cb443e6d6d1bf023a8b6f7e14a478ea7a699c89bbe DIST htb.init-v0.8.5 32038 BLAKE2B a21cc92b3a5d7badc3b3c7813549d25668152e3dd9c7c0f54ca14227b9d6e194a727d5ff97380c2795dbaada71d3b54894c8755f9bf80ba684552de14dc8dfaf SHA512 5f54f662e8b30c4efa6c8cac50eeddfec8650aa6f651065c0962c32067ca7ba17266d20860c296bac44d1f78caa50f6c948f3c55d468a76f9ce2069a43d3c6dd -EBUILD htbinit-0.8.5-r7.ebuild 1567 BLAKE2B 199243f13bcc1ed8ccfc311af3542f2c1d523982c1f769f9a74153c7ceb182883d08fb33f5089c5756b9d436d55b8286f477837793278c0b90385e9141e31083 SHA512 49421c7c1386140c57e5867b291a1c3d10f649ee124bb4097bc774bdf53a1bca046b3b920776f250d02811edcebbeff1c7b6cdf7cced6b8dc8ee8bd2e56cf4aa +EBUILD htbinit-0.8.5-r7.ebuild 1587 BLAKE2B 96737cbb4b66904c0b6a8fece086b632d90a128fb090b6bc2c11f8f03d317913596810d2bb90e5c9137044cfa9167cc8b39743b6994fd7ce557bc36a1751974c SHA512 f1f12a91cfeb7801586323a763789427a3422dd12f3a4872c911f28711228a737f1b5f56b9dfca11288ebf54ce991de63004d638ef15574167ef436b43e02689 MISC metadata.xml 1010 BLAKE2B 72e9cefd1de3576c7388bc98ec7e6a1a12b2668d9749e83240b3822c617ea899fab2ea4f069d2abd19b6aa942023e1b382b1ec3c616622390a881bc3ef53ba1c SHA512 9de719a9c9a15cbac8cfcd43effee95eac182647a0f695c4ff6d791caa4aa19f76d32dea34fbcdaea089ffdd454e2da2d7bd497c070a4b79308d68328a2d0d41 diff --git a/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch b/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch index a798508631d3..f45b5c073493 100644 --- a/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch +++ b/net-misc/htbinit/files/htb.init-v0.8.5_tos.patch @@ -1,5 +1,5 @@ ---- htb.init.old 2005-03-15 14:56:08.328305288 +0200 -+++ htb.init 2005-03-15 15:05:16.612953352 +0200 +--- a/htb.init ++++ b/htb.init @@ -240,6 +240,10 @@ # Maximum packet size HTB creates rate maps for. The default should # be sufficient for most cases, it certainly is for Ethernet. diff --git a/net-misc/htbinit/files/htb.init_find_fix.patch b/net-misc/htbinit/files/htb.init_find_fix.patch index 12222b3e32a5..27fce89ef2da 100644 --- a/net-misc/htbinit/files/htb.init_find_fix.patch +++ b/net-misc/htbinit/files/htb.init_find_fix.patch @@ -1,5 +1,5 @@ ---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 -+++ htb.init 2006-09-08 00:22:11.000000000 +0200 +--- a/htb.init ++++ b/htb.init @@ -468,8 +468,8 @@ ### List of classes in $HTB_PATH htb_class_list () { diff --git a/net-misc/htbinit/files/htb_0.8.5_esfq.diff b/net-misc/htbinit/files/htb_0.8.5_esfq.diff deleted file mode 100644 index 3130f6868a4f..000000000000 --- a/net-misc/htbinit/files/htb_0.8.5_esfq.diff +++ /dev/null @@ -1,53 +0,0 @@ ---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 -+++ htb.init 2006-09-07 23:32:58.000000000 +0200 -@@ -226,7 +226,7 @@ - # priority. Also, classes with higher priority are offered excess - # bandwidth first. - # --# LEAF=none|sfq|pfifo|bfifo optional, default "none" -+# LEAF=none|sfq|esfq|pfifo|bfifo optional, default "none" - # - # Tells the script to attach specified leaf queueing discipline to HTB - # class. By default, no leaf qdisc is used. -@@ -261,6 +261,15 @@ - # will never take place which is what you probably don't want. The - # default value of 10 seconds is probably a good value. - # -+### ESFQ qdisc parameters -+# -+# Same as SFQ and ... -+# -+# HASH=classic|src|dst -+# -+# src mean is fair per source IP -+# dsr mean is fair per destination IP -+# - ### PFIFO/BFIFO qdisc parameters - # - # Those are simple FIFO queueing disciplines. They only have one parameter -@@ -427,14 +445,14 @@ - - ### Modules to probe for. Uncomment the last HTB_PROBE - ### line if you have QoS support compiled into kernel --HTB_PROBE="sch_htb sch_sfq cls_fw cls_u32 cls_route" -+HTB_PROBE="sch_htb sch_sfq sch_esfq cls_fw cls_u32 cls_route" - #HTB_PROBE="" - - ### Config keywords - HTB_QDISC="DEFAULT\|DCACHE\|R2Q" - HTB_CLASS="RATE\|CEIL\|BURST\|CBURST\|PRIO\|LEAF\|MTU" - HTB_CLASS="$HTB_CLASS\|PRIO_RULE\|PRIO_MARK\|PRIO_REALM" --HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB" -+HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB\|HASH" - HTB_CLASS="$HTB_CLASS\|TOS" - - -@@ -801,6 +819,8 @@ - LEAFPARM="${PERTURB:+perturb $PERTURB} ${QUANTUM:+quantum $QUANTUM}" - elif [ "$LEAF" = "pfifo" -o "$LEAF" = "bfifo" ]; then - LEAFPARM="${LIMIT:+limit $LIMIT}" -+ elif [ "$LEAF" = "esfq" ]; then -+ LEAFPARM="${PERTURB:+perturb $PERTURB} ${QUANTUM:+quantum $QUANTUM} ${HASH:+hash $HASH}" - else - htb_fail_off "unknown leaf qdisc ($LEAF) in $classfile!" - fi diff --git a/net-misc/htbinit/files/htb_0.8.5_esfq.patch b/net-misc/htbinit/files/htb_0.8.5_esfq.patch new file mode 100644 index 000000000000..506c505f8e47 --- /dev/null +++ b/net-misc/htbinit/files/htb_0.8.5_esfq.patch @@ -0,0 +1,53 @@ +--- a/htb.init ++++ b/htb.init +@@ -226,7 +226,7 @@ + # priority. Also, classes with higher priority are offered excess + # bandwidth first. + # +-# LEAF=none|sfq|pfifo|bfifo optional, default "none" ++# LEAF=none|sfq|esfq|pfifo|bfifo optional, default "none" + # + # Tells the script to attach specified leaf queueing discipline to HTB + # class. By default, no leaf qdisc is used. +@@ -261,6 +261,15 @@ + # will never take place which is what you probably don't want. The + # default value of 10 seconds is probably a good value. + # ++### ESFQ qdisc parameters ++# ++# Same as SFQ and ... ++# ++# HASH=classic|src|dst ++# ++# src mean is fair per source IP ++# dsr mean is fair per destination IP ++# + ### PFIFO/BFIFO qdisc parameters + # + # Those are simple FIFO queueing disciplines. They only have one parameter +@@ -427,14 +445,14 @@ + + ### Modules to probe for. Uncomment the last HTB_PROBE + ### line if you have QoS support compiled into kernel +-HTB_PROBE="sch_htb sch_sfq cls_fw cls_u32 cls_route" ++HTB_PROBE="sch_htb sch_sfq sch_esfq cls_fw cls_u32 cls_route" + #HTB_PROBE="" + + ### Config keywords + HTB_QDISC="DEFAULT\|DCACHE\|R2Q" + HTB_CLASS="RATE\|CEIL\|BURST\|CBURST\|PRIO\|LEAF\|MTU" + HTB_CLASS="$HTB_CLASS\|PRIO_RULE\|PRIO_MARK\|PRIO_REALM" +-HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB" ++HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB\|HASH" + HTB_CLASS="$HTB_CLASS\|TOS" + + +@@ -801,6 +819,8 @@ + LEAFPARM="${PERTURB:+perturb $PERTURB} ${QUANTUM:+quantum $QUANTUM}" + elif [ "$LEAF" = "pfifo" -o "$LEAF" = "bfifo" ]; then + LEAFPARM="${LIMIT:+limit $LIMIT}" ++ elif [ "$LEAF" = "esfq" ]; then ++ LEAFPARM="${PERTURB:+perturb $PERTURB} ${QUANTUM:+quantum $QUANTUM} ${HASH:+hash $HASH}" + else + htb_fail_off "unknown leaf qdisc ($LEAF) in $classfile!" + fi diff --git a/net-misc/htbinit/files/htb_0.8.5_ipv6.diff b/net-misc/htbinit/files/htb_0.8.5_ipv6.diff deleted file mode 100644 index 815f99545a61..000000000000 --- a/net-misc/htbinit/files/htb_0.8.5_ipv6.diff +++ /dev/null @@ -1,128 +0,0 @@ ---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 -+++ htb.init 2006-09-07 23:32:58.000000000 +0200 -@@ -275,6 +284,7 @@ - ### Filtering parameters - # - # RULE=[[saddr[/prefix]][:port[/mask]],][daddr[/prefix]][:port[/mask]] -+# RULEIPv6=[[saddr[/prefix]][_port[/mask]],][daddr[/prefix]][_port[/mask]] - # - # These parameters make up "u32" filter rules that select traffic for - # each of the classes. You can use multiple RULE fields per config. -@@ -300,9 +310,13 @@ - # RULE=10.5.5.5:80, - # selects traffic going from port 80 of single host 10.5.5.5 - # -+# RULEIPv6=3ffe:80fe:c28:1:45d1:3a1:5e2b:e6c8 -+# selects traffic going to IPv6 host 3ffe:80fe:c28:1:45d1:3a1:5e2b:e6c8 -+# - # - # - # REALM=[srealm,][drealm] -+# REALMIPv6=[srealm,][drealm] - # - # These parameters make up "route" filter rules that classify traffic - # according to packet source/destination realms. For information about -@@ -327,6 +341,7 @@ - # - # - # MARK= -+# MARKIPv6= - # - # These parameters make up "fw" filter rules that select traffic for - # each of the classes accoring to firewall "mark". Mark is a decimal -@@ -414,6 +429,9 @@ - PRIO_RULE_DEFAULT=${PRIO_RULE:-100} - PRIO_MARK_DEFAULT=${PRIO_MARK:-200} - PRIO_REALM_DEFAULT=${PRIO_REALM:-300} -+PRIO_RULEIPv6=${PRIO_RULEIPv6:-150} -+PRIO_MARKIPv6=${PRIO_MARKIPv6:-250} -+PRIO_REALMIPv6=${PRIO_REALMIPv6:-350} - - ### Default HTB_PATH & HTB_CACHE settings - HTB_PATH=${HTB_PATH:-/etc/sysconfig/htb} -@@ -818,6 +838,13 @@ - prio $PRIO_MARK handle $mark fw classid 1:$CLASS - done ### mark - -+ ### Create fw filter for MARKIPv6 fields -+ for mark in `htb_cfile_rules MARKIPv6`; do -+ ### Attach fw filter to root class -+ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \ -+ prio $PRIO_MARKIPv6 handle $mark fw classid 1:$CLASS -+ done ### markipv6 -+ - ### Create route filter for REALM fields - for realm in `htb_cfile_rules REALM`; do - ### Split realm into source & destination realms -@@ -833,6 +860,21 @@ - ${DREALM:+to $DREALM} classid 1:$CLASS - done ### realm - -+ ### Create route filter for REALMIPv6 fields -+ for realm in `htb_cfile_rules REALMIPv6`; do -+ ### Split realm into source & destination realms -+ SREALM=${realm%%,*}; DREALM=${realm##*,} -+ [ "$SREALM" = "$DREALM" ] && SREALM="" -+ -+ ### Convert asterisks to empty strings -+ SREALM=${SREALM#\*}; DREALM=${DREALM#\*} -+ -+ ### Attach route filter to the root class -+ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \ -+ prio $PRIO_REALM route ${SREALM:+from $SREALM} \ -+ ${DREALM:+to $DREALM} classid 1:$CLASS -+ done ### realmipv6 -+ - ### Create u32 filter for RULE fields - for rule in `htb_cfile_rules RULE`; do - ### Split rule into source & destination -@@ -876,6 +918,49 @@ - prio $PRIO_RULE u32 $u32_s $u32_d classid 1:$CLASS - done ### rule - -+ ### Create u32 filter for RULEIPv6 fields -+ for rule in `htb_cfile_rules RULEIPv6`; do -+ ### Split rule into source & destination -+ SRC=${rule%%,*}; DST=${rule##*,} -+ [ "$SRC" = "$rule" ] && SRC="" -+ -+ -+ ### Split destination into address, port & mask fields -+ DADDR=${DST%%_*}; DTEMP=${DST##*_} -+ [ "$DADDR" = "$DST" ] && DTEMP="" -+ -+ DPORT=${DTEMP%%/*}; DMASK=${DTEMP##*/} -+ [ "$DPORT" = "$DTEMP" ] && DMASK="0xffff" -+ -+ -+ ### Split up source (if specified) -+ SADDR=""; SPORT="" -+ if [ -n "$SRC" ]; then -+ SADDR=${SRC%%_*}; STEMP=${SRC##*_} -+ [ "$SADDR" = "$SRC" ] && STEMP="" -+ -+ SPORT=${STEMP%%/*}; SMASK=${STEMP##*/} -+ [ "$SPORT" = "$STEMP" ] && SMASK="0xffff" -+ fi -+ -+ -+ ### Convert asterisks to empty strings -+ SADDR=${SADDR#\*}; DADDR=${DADDR#\*} -+ -+ ### Compose u32 filter rules -+ u32_s="${SPORT:+match ip6 sport $SPORT $SMASK}" -+ u32_s="${SADDR:+match ip6 src $SADDR} $u32_s" -+ u32_d="${DPORT:+match ip6 dport $DPORT $DMASK}" -+ u32_d="${DADDR:+match ip6 dst $DADDR} $u32_d" -+ -+ ### Uncomment the following if you want to see parsed rules -+ #echo "$rule: $u32_s $u32_d" -+ -+ ### Attach u32 filter to the appropriate class -+ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \ -+ prio $PRIO_RULEIPv6 u32 $u32_s $u32_d classid 1:$CLASS -+ done ### ruleipv6 -+ - [ "$1" = "compile" ] && echo - done ### classfile - ;; diff --git a/net-misc/htbinit/files/htb_0.8.5_ipv6.patch b/net-misc/htbinit/files/htb_0.8.5_ipv6.patch new file mode 100644 index 000000000000..6e99319f2c62 --- /dev/null +++ b/net-misc/htbinit/files/htb_0.8.5_ipv6.patch @@ -0,0 +1,128 @@ +--- a/htb.init ++++ b/htb.init +@@ -275,6 +284,7 @@ + ### Filtering parameters + # + # RULE=[[saddr[/prefix]][:port[/mask]],][daddr[/prefix]][:port[/mask]] ++# RULEIPv6=[[saddr[/prefix]][_port[/mask]],][daddr[/prefix]][_port[/mask]] + # + # These parameters make up "u32" filter rules that select traffic for + # each of the classes. You can use multiple RULE fields per config. +@@ -300,9 +310,13 @@ + # RULE=10.5.5.5:80, + # selects traffic going from port 80 of single host 10.5.5.5 + # ++# RULEIPv6=3ffe:80fe:c28:1:45d1:3a1:5e2b:e6c8 ++# selects traffic going to IPv6 host 3ffe:80fe:c28:1:45d1:3a1:5e2b:e6c8 ++# + # + # + # REALM=[srealm,][drealm] ++# REALMIPv6=[srealm,][drealm] + # + # These parameters make up "route" filter rules that classify traffic + # according to packet source/destination realms. For information about +@@ -327,6 +341,7 @@ + # + # + # MARK= ++# MARKIPv6= + # + # These parameters make up "fw" filter rules that select traffic for + # each of the classes accoring to firewall "mark". Mark is a decimal +@@ -414,6 +429,9 @@ + PRIO_RULE_DEFAULT=${PRIO_RULE:-100} + PRIO_MARK_DEFAULT=${PRIO_MARK:-200} + PRIO_REALM_DEFAULT=${PRIO_REALM:-300} ++PRIO_RULEIPv6=${PRIO_RULEIPv6:-150} ++PRIO_MARKIPv6=${PRIO_MARKIPv6:-250} ++PRIO_REALMIPv6=${PRIO_REALMIPv6:-350} + + ### Default HTB_PATH & HTB_CACHE settings + HTB_PATH=${HTB_PATH:-/etc/sysconfig/htb} +@@ -818,6 +838,13 @@ + prio $PRIO_MARK handle $mark fw classid 1:$CLASS + done ### mark + ++ ### Create fw filter for MARKIPv6 fields ++ for mark in `htb_cfile_rules MARKIPv6`; do ++ ### Attach fw filter to root class ++ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \ ++ prio $PRIO_MARKIPv6 handle $mark fw classid 1:$CLASS ++ done ### markipv6 ++ + ### Create route filter for REALM fields + for realm in `htb_cfile_rules REALM`; do + ### Split realm into source & destination realms +@@ -833,6 +860,21 @@ + ${DREALM:+to $DREALM} classid 1:$CLASS + done ### realm + ++ ### Create route filter for REALMIPv6 fields ++ for realm in `htb_cfile_rules REALMIPv6`; do ++ ### Split realm into source & destination realms ++ SREALM=${realm%%,*}; DREALM=${realm##*,} ++ [ "$SREALM" = "$DREALM" ] && SREALM="" ++ ++ ### Convert asterisks to empty strings ++ SREALM=${SREALM#\*}; DREALM=${DREALM#\*} ++ ++ ### Attach route filter to the root class ++ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \ ++ prio $PRIO_REALM route ${SREALM:+from $SREALM} \ ++ ${DREALM:+to $DREALM} classid 1:$CLASS ++ done ### realmipv6 ++ + ### Create u32 filter for RULE fields + for rule in `htb_cfile_rules RULE`; do + ### Split rule into source & destination +@@ -876,6 +918,49 @@ + prio $PRIO_RULE u32 $u32_s $u32_d classid 1:$CLASS + done ### rule + ++ ### Create u32 filter for RULEIPv6 fields ++ for rule in `htb_cfile_rules RULEIPv6`; do ++ ### Split rule into source & destination ++ SRC=${rule%%,*}; DST=${rule##*,} ++ [ "$SRC" = "$rule" ] && SRC="" ++ ++ ++ ### Split destination into address, port & mask fields ++ DADDR=${DST%%_*}; DTEMP=${DST##*_} ++ [ "$DADDR" = "$DST" ] && DTEMP="" ++ ++ DPORT=${DTEMP%%/*}; DMASK=${DTEMP##*/} ++ [ "$DPORT" = "$DTEMP" ] && DMASK="0xffff" ++ ++ ++ ### Split up source (if specified) ++ SADDR=""; SPORT="" ++ if [ -n "$SRC" ]; then ++ SADDR=${SRC%%_*}; STEMP=${SRC##*_} ++ [ "$SADDR" = "$SRC" ] && STEMP="" ++ ++ SPORT=${STEMP%%/*}; SMASK=${STEMP##*/} ++ [ "$SPORT" = "$STEMP" ] && SMASK="0xffff" ++ fi ++ ++ ++ ### Convert asterisks to empty strings ++ SADDR=${SADDR#\*}; DADDR=${DADDR#\*} ++ ++ ### Compose u32 filter rules ++ u32_s="${SPORT:+match ip6 sport $SPORT $SMASK}" ++ u32_s="${SADDR:+match ip6 src $SADDR} $u32_s" ++ u32_d="${DPORT:+match ip6 dport $DPORT $DMASK}" ++ u32_d="${DADDR:+match ip6 dst $DADDR} $u32_d" ++ ++ ### Uncomment the following if you want to see parsed rules ++ #echo "$rule: $u32_s $u32_d" ++ ++ ### Attach u32 filter to the appropriate class ++ tc filter add dev $DEVICE parent 1:0 protocol ipv6 \ ++ prio $PRIO_RULEIPv6 u32 $u32_s $u32_d classid 1:$CLASS ++ done ### ruleipv6 ++ + [ "$1" = "compile" ] && echo + done ### classfile + ;; diff --git a/net-misc/htbinit/files/prio_rule.patch b/net-misc/htbinit/files/prio_rule.patch index 28471aabb84e..429a1bed0ad1 100644 --- a/net-misc/htbinit/files/prio_rule.patch +++ b/net-misc/htbinit/files/prio_rule.patch @@ -1,5 +1,5 @@ ---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 -+++ htb.init 2006-09-08 00:03:32.000000000 +0200 +--- a/htb.init ++++ b/htb.init @@ -453,7 +457,7 @@ ### Load & filter file $HTB_PATH/$1 htb_filter_file () { diff --git a/net-misc/htbinit/files/timecheck_fix.patch b/net-misc/htbinit/files/timecheck_fix.patch index de3791af997d..4797ea6fd0ab 100644 --- a/net-misc/htbinit/files/timecheck_fix.patch +++ b/net-misc/htbinit/files/timecheck_fix.patch @@ -1,5 +1,5 @@ ---- htb.init.old 2004-01-29 22:41:23.000000000 +0100 -+++ htb.init 2006-09-08 00:11:36.000000000 +0200 +--- a/htb.init ++++ b/htb.init @@ -891,7 +895,6 @@ TIME_TMP=`date +%w/%k:%M` TIME_DOW=${TIME_TMP%%/*} diff --git a/net-misc/htbinit/htbinit-0.8.5-r7.ebuild b/net-misc/htbinit/htbinit-0.8.5-r7.ebuild index 2fab64e9f103..1ae14a2d6a5b 100644 --- a/net-misc/htbinit/htbinit-0.8.5-r7.ebuild +++ b/net-misc/htbinit/htbinit-0.8.5-r7.ebuild @@ -1,27 +1,36 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=5 -inherit eutils linux-info +EAPI=7 + +inherit linux-info DESCRIPTION="Sets up Hierachical Token Bucket based traffic control (QoS) with iproute2" HOMEPAGE="https://www.sourceforge.net/projects/htbinit/" SRC_URI="mirror://sourceforge/htbinit/htb.init-v${PV}" +S="${WORKDIR}" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 ~ppc x86" -IUSE="ipv6 esfq" +IUSE="esfq ipv6" DEPEND="sys-apps/iproute2" RDEPEND="${DEPEND}" -S=${WORKDIR} +PATCHES=( + "${FILESDIR}"/htb.init-v0.8.5_tos.patch + "${FILESDIR}"/prio_rule.patch + "${FILESDIR}"/timecheck_fix.patch + "${FILESDIR}"/htb.init_find_fix.patch +) pkg_setup() { + local i for i in NET_SCH_HTB NET_SCH_SFQ NET_CLS_FW NET_CLS_U32 NET_CLS_ROUTE4 ; do CONFIG_CHECK="${CONFIG_CHECK} ~${i}" done + use esfq && CONFIG_CHECK="${CONFIG_CHECK} ~NET_SCH_ESFQ" linux-info_pkg_setup } @@ -31,14 +40,15 @@ src_unpack() { } src_prepare() { - sed -i 's|/etc/sysconfig/htb|/etc/htb|g' "${S}"/htb.init - epatch "${FILESDIR}"/htb.init-v0.8.5_tos.patch - use ipv6 && epatch "${FILESDIR}"/htb_0.8.5_ipv6.diff - use esfq && epatch "${FILESDIR}"/htb_0.8.5_esfq.diff - epatch "${FILESDIR}"/prio_rule.patch - epatch "${FILESDIR}"/timecheck_fix.patch - epatch "${FILESDIR}"/htb.init_find_fix.patch - sed -i -e 's:/sbin/ip:/bin/ip:g' "${S}"/htb.init # bug #474700 + default + + sed -i 's|/etc/sysconfig/htb|/etc/htb|g' "${S}"/htb.init || die + + use esfq && eapply "${FILESDIR}"/htb_0.8.5_esfq.patch + use ipv6 && eapply "${FILESDIR}"/htb_0.8.5_ipv6.patch + + # bug #474700 + sed -i -e 's:/sbin/ip:/bin/ip:g' "${S}"/htb.init || die } src_compile() { @@ -47,12 +57,14 @@ src_compile() { src_install() { dosbin htb.init + newinitd "${FILESDIR}"/htbinit.rc htbinit + keepdir /etc/htb } pkg_postinst() { - if [[ -z ${REPLACING_VERSIONS} ]] ; then + if [[ -z "${REPLACING_VERSIONS}" ]] ; then elog 'Run "rc-update add htbinit default" to run htb.init at startup.' elog 'Please, read carefully the htb.init documentation.' elog 'New directory to store configuration is /etc/htb.' -- cgit v1.2.3