Commit 2e7b2088 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use seqno_plus throughout.

parent 1989baa3
......@@ -266,7 +266,7 @@ main(int argc, char **argv)
} else {
debugf("Got %s %d %ld from babel-state.\n",
format_address(sid), s, t);
myseqno = ((s + 1) & 0xFFFF);
myseqno = seqno_plus(s, 1);
if(t >= 1176800000L && t <= now.tv_sec)
reboot_time = t;
}
......
......@@ -357,7 +357,7 @@ void
send_hello_noupdate(struct network *net, unsigned interval)
{
debugf("Sending hello to %s.\n", net->ifname);
net->hello_seqno = ((net->hello_seqno + 1) & 0xFFFF);
net->hello_seqno = seqno_plus(net->hello_seqno, 1);
net->hello_time = now.tv_sec;
send_message(net, 0, 0, net->hello_seqno,
interval > 0xFFFF ? 0 : interval,
......@@ -507,7 +507,7 @@ flushupdates(void)
if(src) {
really_send_update(net, src->address, src->prefix, src->plen,
src->metric >= INFINITY ?
src->seqno : (src->seqno + 1) & 0xFFFF,
src->seqno : seqno_plus(src->seqno, 1),
INFINITY);
continue;
}
......@@ -607,7 +607,7 @@ send_self_update(struct network *net, int force_seqno)
{
int i;
if(force_seqno || seqno_time + seqno_interval < now.tv_sec) {
myseqno = ((myseqno + 1) & 0xFFFF);
myseqno = seqno_plus(myseqno, 1);
seqno_time = now.tv_sec;
}
......@@ -642,7 +642,7 @@ send_self_retract(struct network *net)
debugf("Retracting self on %s.\n", net->ifname);
myseqno = ((myseqno + 1) & 0xFFFF);
myseqno = seqno_plus(myseqno, 1);
seqno_time = now.tv_sec;
net->self_update_time = now.tv_sec;
for(i = 0; i < numxroutes; i++) {
......
......@@ -159,7 +159,7 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
if(missed_hellos > 0) {
neigh->reach >>= missed_hellos;
neigh->hello_seqno = (neigh->hello_seqno + missed_hellos) & 0xFFFF;
neigh->hello_seqno = seqno_plus(neigh->hello_seqno, missed_hellos);
missed_hellos = 0;
rc = 1;
}
......
......@@ -275,7 +275,7 @@ update_route_metric(struct route *route)
oldmetric = route->metric;
if(route->time < now.tv_sec - route_timeout_delay) {
if(route->refmetric < INFINITY) {
route->seqno = (route->src->seqno + 1) & 0xFFFF;
route->seqno = seqno_plus(route->src->seqno, 1);
route->refmetric = INFINITY;
}
newmetric = INFINITY;
......
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