Commit 99239dc9 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix computation of metric when sending updates.

parent 0c36358a
...@@ -692,6 +692,7 @@ really_send_update(struct network *net, ...@@ -692,6 +692,7 @@ really_send_update(struct network *net,
add_metric = output_filter(id, prefix, plen, net->ifindex); add_metric = output_filter(id, prefix, plen, net->ifindex);
if(add_metric < INFINITY) { if(add_metric < INFINITY) {
metric = MIN(metric + add_metric, INFINITY);
if(plen >= 96 && v4mapped(prefix)) { if(plen >= 96 && v4mapped(prefix)) {
const unsigned char *sid; const unsigned char *sid;
unsigned char v4route[16]; unsigned char v4route[16];
...@@ -704,8 +705,7 @@ really_send_update(struct network *net, ...@@ -704,8 +705,7 @@ really_send_update(struct network *net,
sid = message_source_id(net); sid = message_source_id(net);
if(sid == NULL || memcmp(id, sid, 16) != 0) if(sid == NULL || memcmp(id, sid, 16) != 0)
send_message(net, 3, 0xFF, 0, 0, 0xFFFF, id); send_message(net, 3, 0xFF, 0, 0, 0xFFFF, id);
send_message(net, 5, plen - 96, 0, seqno, metric + add_metric, send_message(net, 5, plen - 96, 0, seqno, metric, v4route);
v4route);
} else { } else {
if(in_prefix(id, prefix, plen)) { if(in_prefix(id, prefix, plen)) {
send_message(net, 3, plen, 0, seqno, metric, id); send_message(net, 3, plen, 0, seqno, metric, id);
...@@ -715,8 +715,7 @@ really_send_update(struct network *net, ...@@ -715,8 +715,7 @@ really_send_update(struct network *net,
sid = message_source_id(net); sid = message_source_id(net);
if(sid == NULL || memcmp(id, sid, 16) != 0) if(sid == NULL || memcmp(id, sid, 16) != 0)
send_message(net, 3, 0xFF, 0, 0, 0xFFFF, id); send_message(net, 3, 0xFF, 0, 0, 0xFFFF, id);
send_message(net, 4, plen, 0, seqno, metric + add_metric, send_message(net, 4, plen, 0, seqno, metric, prefix);
prefix);
} }
} }
} }
......
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