Comments (15)
Aha, thank you https://github.com/clostra/dcdn/blob/master/client.c#L222
from dht.
Fixed in 7166f21. Thanks.
from dht.
I've also added explicit support for implicit_port
in 5853ed1. This is completely untested, @carlreinke, @ghazel, please be so kind as too proof-read me.
from dht.
Tested 5853ed1 with transmission. No problems. Thousands of implied_port
, every last one Both port and implied_port.
if(implied_port != 0) {
if(port != 0) {
debugf("Both port and implied_port.\n");
/* But continue, that's what the spec says. */
}
switch(from->sa_family) {
case AF_INET:
port = htons(((struct sockaddr_in*)from)->sin_port);
debugf("Announce_peer: AF_INET implied_port %d.\n", port);
break;
case AF_INET6:
port = htons(((struct sockaddr_in6*)from)->sin6_port);
debugf("Announce_peer: AF_INET6 implied_port %d.\n", port);
break;
default:
port = 0;
debugf("Announce_peer: unsupported sa_family! implied port set zero.\n");
break;
}
}
from dht.
OK, it seems to be about 25 per thousand implied_port
that don't have Both port and implied_port
.
from dht.
from dht.
I think it might make sense to log the inverse. Does this make sense?
if(implied_port != 0) {
if(port == 0) {
debugf("implied_port alone.\n");
}
/* Continue either way, that's what the spec says. */
from dht.
from dht.
OK, recommend removing the debug statement. It's not about debugging the DHT.
from dht.
Aha, thank you https://github.com/clostra/dcdn/blob/master/client.c#L222
0.24 implementation and DHT pollution.
https://github.com/cfpp2p/dht-trs-trs/tree/port-logging logged:
Forty-two percent of 118,152 messages contained optional implied_port
.
Of those, 98 percent contain both
non zero port
and flagged (non zero) implied_port
.
Twenty-four percent of those,
derived (implied) port value differed from port
value.
With 0.24
twenty-four percent would have announce peer port incorrect,
NOT based on derived port, but on port
.
With 0.24
remaining two percent
messages containing optional implied_port
,
those with port
=0 (or missing) and implied_port
flagged on,
would then announce peer port 1.
Of course this is assuming that port
precedes implied_port
in the message, which I didn't check.
from dht.
Bencoding has lexigraphically sorted keys, so implied_port
should come first.
from dht.
from dht.
Sounds like a fun challenge. How many lines would be acceptable?
from dht.
from dht.
How about net 8 lines? #31
from dht.
Related Issues (16)
- Bug Report HOT 1
- free(buckets6) HOT 3
- Implement support for BEP-14 Local Service Discovery HOT 3
- making libdht HOT 2
- BEP-44 support? HOT 4
- Send a version string even if the client does not provide one HOT 1
- API improvements around DHT_EVENT_SEARCH_DONE notification HOT 3
- Include client version string in messages HOT 1
- the Bootstrapping dht_ping_node
- Enhance bootstrapping mechanism HOT 2
- It this a complete implementation for Kademlia DHT? HOT 2
- find_closest HOT 1
- Redundant check introduced in 71d4372 HOT 1
- Is this project dead ? HOT 1
- Storing values HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dht.