summaryrefslogtreecommitdiff
path: root/net/quagga/files/patch-cvs-4-nexthop_active_update
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2007-08-28 10:48:38 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2007-08-28 10:48:38 +0000
commitffa593b51af801191dc5aeae98ff8ebed72dfb78 (patch)
tree1d486735a2c77c62394d89c2e15126e9ead7e9b0 /net/quagga/files/patch-cvs-4-nexthop_active_update
parentUpdate to 0.11 (diff)
- Integrate patches from quagga CVS.
They fix a few problems with inconsistences routes between quagga and kernel route tables, loss MTU, assert in route-map code, etc. Submitted by: Yandex company Approved by: maintainer
Notes
Notes: svn path=/head/; revision=198447
Diffstat (limited to 'net/quagga/files/patch-cvs-4-nexthop_active_update')
-rw-r--r--net/quagga/files/patch-cvs-4-nexthop_active_update47
1 files changed, 47 insertions, 0 deletions
diff --git a/net/quagga/files/patch-cvs-4-nexthop_active_update b/net/quagga/files/patch-cvs-4-nexthop_active_update
new file mode 100644
index 000000000000..11ae35a428d5
--- /dev/null
+++ b/net/quagga/files/patch-cvs-4-nexthop_active_update
@@ -0,0 +1,47 @@
+--- zebra/zebra_rib.c.orig 2007-06-25 14:17:53.000000000 +0400
++++ zebra/zebra_rib.c 2007-08-08 11:38:18.000000000 +0400
+@@ -795,27 +795,32 @@
+ return CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
+ }
+
++/* Iterate over all nexthops of the given RIB entry and refresh their
++ * ACTIVE flag. rib->nexthop_active_num is updated accordingly. If any
++ * nexthop is found to toggle the ACTIVE flag, the whole rib structure
++ * is flagged with ZEBRA_FLAG_CHANGED. The 4th 'set' argument is
++ * transparently passed to nexthop_active_check().
++ *
++ * Return value is the new number of active nexthops.
++ */
++
+ static int
+ nexthop_active_update (struct route_node *rn, struct rib *rib, int set)
+ {
+ struct nexthop *nexthop;
+- int active;
++ int prev_active, new_active;
+
+ rib->nexthop_active_num = 0;
+ UNSET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
+
+ for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
+- {
+- active = CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
+-
+- nexthop_active_check (rn, rib, nexthop, set);
+- if ((MULTIPATH_NUM == 0 || rib->nexthop_active_num < MULTIPATH_NUM)
+- && active != CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
+- SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
+-
+- if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
+- rib->nexthop_active_num++;
+- }
++ {
++ prev_active = CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
++ if ((new_active = nexthop_active_check (rn, rib, nexthop, set)))
++ rib->nexthop_active_num++;
++ if (prev_active != new_active)
++ SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
++ }
+ return rib->nexthop_active_num;
+ }
+