mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-08 22:08:00 +00:00
don't accept DHT posts with time in far-future.
(timeline still need to be fixed though)
This commit is contained in:
parent
00b67caea4
commit
a7e9b67e37
@ -121,6 +121,14 @@ void dht_get_observer::reply(msg const& m)
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
int64 p_time = p->dict_find_int_value("time");
|
||||
if(!p_time || p_time > GetAdjustedTime() + 2*60*60 ) {
|
||||
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
||||
TORRENT_LOG(traversal) << "dht_get_observer::reply invalid time";
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
values_list.push_back(entry());
|
||||
values_list.back() = *e;
|
||||
|
@ -1430,6 +1430,11 @@ void node_impl::incoming_request(msg const& m, entry& e)
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg_keys[mk_time]->int_value() > GetAdjustedTime() + 2*60*60) {
|
||||
incoming_error(e, "time > GetAdjustedTime");
|
||||
return;
|
||||
}
|
||||
|
||||
m_table.node_seen(id, m.addr, 0xffff);
|
||||
//f->last_seen = time_now();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user