[packages] olsrd: Fix quagga plugin metric parsing
[packages.git] / net / olsrd / patches / 110-fix_metric_parsing.patch
1 diff --git a/lib/quagga/src/parse.c b/lib/quagga/src/parse.c
2 index 5220849..8672fab 100644
3 --- a/lib/quagga/src/parse.c
4 +++ b/lib/quagga/src/parse.c
5 @@ -103,11 +103,11 @@ static struct zroute
6  
7  // Quagga v0.98.6 BUG workaround: metric is always sent by zebra
8  // even without ZAPI_MESSAGE_METRIC message.
9 -//  if (r.message & ZAPI_MESSAGE_METRIC) {
10 +  if ((r->message & ZAPI_MESSAGE_METRIC) || !zebra.version) {
11      memcpy(&r->metric, pnt, sizeof r->metric);
12      r->metric = ntohl(r->metric);
13      pnt += sizeof r->metric;
14 -//  }
15 +  }
16  
17    if (pnt - opt != length) {
18      olsr_exit("(QUAGGA) Length does not match!", EXIT_FAILURE);