mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Remove ip address change flapping detection. It is not really needed and I do not think it works quite right.
svn:r5423
This commit is contained in:
parent
4ddf2385a0
commit
901712ee59
@ -94,7 +94,7 @@ static char* nt_strerror(uint32_t errnum);
|
|||||||
|
|
||||||
#define FORCE_REGENERATE_DESCRIPTOR_INTERVAL 18*60*60 /* 18 hours */
|
#define FORCE_REGENERATE_DESCRIPTOR_INTERVAL 18*60*60 /* 18 hours */
|
||||||
#define CHECK_DESCRIPTOR_INTERVAL 60 /* one minute */
|
#define CHECK_DESCRIPTOR_INTERVAL 60 /* one minute */
|
||||||
#define CHECK_IPADDRESS_INTERVAL (5*60) /* five minutes */
|
#define CHECK_IPADDRESS_INTERVAL (15*60) /* five minutes */
|
||||||
#define BUF_SHRINK_INTERVAL 60 /* one minute */
|
#define BUF_SHRINK_INTERVAL 60 /* one minute */
|
||||||
#define DESCRIPTOR_RETRY_INTERVAL 10
|
#define DESCRIPTOR_RETRY_INTERVAL 10
|
||||||
#define DESCRIPTOR_FAILURE_RESET_INTERVAL 60*60
|
#define DESCRIPTOR_FAILURE_RESET_INTERVAL 60*60
|
||||||
|
@ -910,15 +910,12 @@ check_descriptor_bandwidth_changed(time_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_IPADDRESS_CHANGE_FREQ 60*60
|
|
||||||
/** Check whether our own address as defined by the Address configuration
|
/** Check whether our own address as defined by the Address configuration
|
||||||
* has changed. This is for routers that get their address from a service
|
* has changed. This is for routers that get their address from a service
|
||||||
* like dyndns. If our address has changed, mark our descriptor dirty. */
|
* like dyndns. If our address has changed, mark our descriptor dirty. */
|
||||||
void
|
void
|
||||||
check_descriptor_ipaddress_changed(time_t now)
|
check_descriptor_ipaddress_changed(time_t now)
|
||||||
{
|
{
|
||||||
static time_t last_changed = 0;
|
|
||||||
static time_t last_warned_lastchangetime = 0;
|
|
||||||
uint32_t prev, cur;
|
uint32_t prev, cur;
|
||||||
or_options_t *options = get_options();
|
or_options_t *options = get_options();
|
||||||
|
|
||||||
@ -943,19 +940,8 @@ check_descriptor_ipaddress_changed(time_t now)
|
|||||||
in_cur.s_addr = htonl(cur);
|
in_cur.s_addr = htonl(cur);
|
||||||
tor_inet_ntoa(&in_cur, addrbuf_cur, sizeof(addrbuf_cur));
|
tor_inet_ntoa(&in_cur, addrbuf_cur, sizeof(addrbuf_cur));
|
||||||
|
|
||||||
if (last_changed+MAX_IPADDRESS_CHANGE_FREQ < now) {
|
|
||||||
info(LD_GENERAL,"Our IP Address has changed from %s to %s; rebuilding descriptor.", addrbuf_prev, addrbuf_cur);
|
info(LD_GENERAL,"Our IP Address has changed from %s to %s; rebuilding descriptor.", addrbuf_prev, addrbuf_cur);
|
||||||
mark_my_descriptor_dirty();
|
mark_my_descriptor_dirty();
|
||||||
last_changed = now;
|
|
||||||
last_warned_lastchangetime = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (last_warned_lastchangetime != last_changed) {
|
|
||||||
warn(LD_GENERAL,"Our IP Address seems to be flapping. It has changed twice within one hour (from %s to %s this time). Ignoring for now.", addrbuf_prev, addrbuf_cur);
|
|
||||||
last_warned_lastchangetime = last_changed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user