Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv4 filter enhancement #112

Closed
chros73 opened this issue Dec 10, 2017 · 0 comments
Closed

IPv4 filter enhancement #112

chros73 opened this issue Dec 10, 2017 · 0 comments

Comments

@chros73
Copy link
Owner

chros73 commented Dec 10, 2017

A. Overview

Backport @sallyswiss's IPv4 filter enhancement that is:

  • not a memory hog
  • supports p2p lists as well (along with cidr notaion: 10.0.0.0/8)
    • e.g. from bluetack
    • line format: foo bar:1.2.3.4-5.6.7.8
    • strores ranges as in p2p file format
    • supports comments in file
    • with LOG_PEER_INFO log level it logs when connection to unwanted peer is prevented
  • still has quick log n lookup time for extents data structure
    • use ordered map instead of sparse hash

B. Usage

Download and extract one of the links into your session directory (first one is updated daily):

Add this into your rtorrent config:

# Loads unwanted peers from external text file into IPv4 Filter every day, e.g.:
#   - https://silo.glasz.org/antip2p.list.gz (https://gist.github.com/glaszig/bf96beccf4694ae25d4f1f7cc6224985)
#   - https://www.wael.name/wael.list.p2p.gz (https://www.wael.name/other/best-blocklist/)
#schedule2 = load_ipv4_filter, 0, 24:00:00, "ipv4_filter.load=(cat,(session.path),antip2p.list),unwanted"
schedule2 = load_ipv4_filter, 0, 24:00:00, "ipv4_filter.load=(cat,(session.path),Wael-Blacklist-v8.dat),unwanted"

You can debug it with CTRL+X and one of the following:

print=(ipv4_filter.size_data)
print=(ipv4_filter.get,10.10.10.10)
print=(ipv4_filter.dump)

C. References

More info about IPv4 Filtering in rtorrent.

Relates to: rakshasa/rtorrent#109 , rakshasa/libtorrent#32, rakshasa/rtorrent#71, rakshasa/rtorrent#106

@chros73 chros73 added this to the 1.6.1-0.9.7 milestone Dec 10, 2017
@chros73 chros73 changed the title IPv4 filter modification IPv4 filter enhancement Dec 10, 2017
zmike808 pushed a commit to zmike808/rtorrent-ps-ch that referenced this issue May 18, 2019
I'm not sure what exactly caused it but my installation of rTorrent-PS was consistently segfaulting here. I fiddled with it a bit and it seemed that it was indexing with a negative value. As far as I can tell, there's no way for `rcol` to be negative so it must have been the ratio (couldn't tell for sure because `ratio` was optimized out and not viewable in the debugger).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant