猫在教育网机子上挂PT, 但是机子同时是内网的IPv6网关(HE的/64), 结果rtorrent每次返回给tracker的&ipv6=后面总是我在HE的2001:470:xx:xx::1, 和教育网PT上其他用户之间连接效果差爆了.
在折腾了几种workaround无效后, 最后不得不改libtorrent的代码了! 由于ipv6部分本身就是由一个patch加上去的, 我只需要对这个patch再patch一次即可:
安装过程就不再赘述了, 满网上都是的…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
--- A/libtorrent-0.12.6-ipv6-07.patch 2011-08-19 00:02:03.603735921 +0800 +++ B/libtorrent-0.12.6-ipv6-07.patch 2011-08-19 00:36:14.824983083 +0800 @@ -417,7 +417,7 @@ diff -Nur libtorrent-0.12.6.orig/src/net/local_addr.cc libtorrent-0.12.6/src/net/local_addr.cc --- libtorrent-0.12.6.orig/src/net/local_addr.cc 1970-01-01 01:00:00.000000000 +0100 +++ libtorrent-0.12.6/src/net/local_addr.cc 2010-07-23 14:44:51.000000000 +0200 -@@ -0,0 +1,336 @@ +@@ -0,0 +1,340 @@ +// libTorrent - BitTorrent library +// Copyright (C) 2005-2007, Jari Sundell +// @@ -502,29 +502,33 @@ +#ifdef RAK_USE_INET6 +// IPv6 priority, from highest to lowest: +// -+// 1. Global address (2000::/16 not in 6to4 or Teredo) -+// 2. 6to4 (2002::/16) -+// 3. Teredo (2001::/32) -+// 4. Empty/INADDR_ANY (::) -+// 5. Everything else (link-local, ULA, etc.) ++// 1. cernet & cernet2 address (2001:250::/32 and 2001:da8::/32) ++// 2. Other global address (2000::/16 not in 6to4 or Teredo) ++// 3. 6to4 (2002::/16) ++// 4. Teredo (2001::/32) ++// 5. Empty/INADDR_ANY (::) ++// 6. Everything else (link-local, ULA, etc.) +int get_priority_ipv6(const in6_addr& addr) { + const uint32_t *addr32 = reinterpret_cast<const uint32_t *>(addr.s6_addr); + if (addr32[0] == htonl(0) && + addr32[1] == htonl(0) && + addr32[2] == htonl(0) && + addr32[3] == htonl(0)) { -+ return 4; ++ return 5; + } + if (addr32[0] == htonl(0x20010000)) { -+ return 3; ++ return 4; + } + if ((addr32[0] & htonl(0xffff0000)) == htonl(0x20020000)) { -+ return 2; ++ return 3; + } -+ if ((addr32[0] & htonl(0xe0000000)) == htonl(0x20000000)) { ++ if (addr32[0] == htonl(0x20010250) || addr32[0] == htonl(0x20010da8)) { + return 1; + } -+ return 5; ++ if ((addr32[0] & htonl(0xe0000000)) == htonl(0x20000000)) { ++ return 2; ++ } ++ return 6; +} +#endif + |
this is so great
博主主要刷哪个PT?
各方面大站一个不漏…
HE的v6是VPN麽?
HE的v6 endpoint是VPN服务器出口
我通过教育网IPv6连到vpn服务器, 然后把整个tunnel建在教育网内网…
ping值还有速度如何..?
完全取决于vpn的质量啊…所有流量都走vpn了…..
噢,这麽复杂。。
Thank you for sharing this graet tip