Commit f3ed6390 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Change seqno_time to be a timeval.

parent 9987e139
...@@ -48,7 +48,7 @@ int silent_time = 30; ...@@ -48,7 +48,7 @@ int silent_time = 30;
int split_horizon = 1; int split_horizon = 1;
unsigned short myseqno = 0; unsigned short myseqno = 0;
int seqno_time = 0; struct timeval seqno_time = {0, 0};
int seqno_interval = -1; int seqno_interval = -1;
struct buffered_update { struct buffered_update {
...@@ -788,9 +788,9 @@ send_update(struct network *net, int urgent, ...@@ -788,9 +788,9 @@ send_update(struct network *net, int urgent,
void void
update_myseqno(int force) update_myseqno(int force)
{ {
if(force || seqno_time + (seqno_interval + 500) / 1000 < now.tv_sec) { if(force || timeval_minus_msec(&now, &seqno_time) >= seqno_interval) {
myseqno = seqno_plus(myseqno, 1); myseqno = seqno_plus(myseqno, 1);
seqno_time = now.tv_sec; seqno_time = now;
} }
} }
...@@ -838,7 +838,7 @@ send_self_retract(struct network *net) ...@@ -838,7 +838,7 @@ send_self_retract(struct network *net)
debugf("Retracting self on %s.\n", net->ifname); debugf("Retracting self on %s.\n", net->ifname);
myseqno = seqno_plus(myseqno, 1); myseqno = seqno_plus(myseqno, 1);
seqno_time = now.tv_sec; seqno_time = now;
delay_jitter(&net->self_update_time, &net->self_update_timeout, delay_jitter(&net->self_update_time, &net->self_update_timeout,
net->self_update_interval); net->self_update_interval);
for(i = 0; i < numxroutes; i++) { for(i = 0; i < numxroutes; i++) {
......
...@@ -23,7 +23,7 @@ THE SOFTWARE. ...@@ -23,7 +23,7 @@ THE SOFTWARE.
#define MAX_BUFFERED_UPDATES 200 #define MAX_BUFFERED_UPDATES 200
extern unsigned short myseqno; extern unsigned short myseqno;
extern int seqno_time; extern struct timeval seqno_time;
extern int seqno_interval; extern int seqno_interval;
extern int parasitic; extern int parasitic;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment