summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorpaul <paul>2003-11-17 09:15:18 +0000
committerpaul <paul>2003-11-17 09:15:18 +0000
commitc6867eb09b88b2b256e8d66097cb1f43ae897f5f (patch)
tree037e1ffccc0c8dd5f5e87584f2632a18fa56a0ea /ripd
parent9678290672577d961b70e8c40a856a231c2da9fc (diff)
downloadquagga-c6867eb09b88b2b256e8d66097cb1f43ae897f5f.tar.bz2
quagga-c6867eb09b88b2b256e8d66097cb1f43ae897f5f.tar.xz
2003-11-17 sowmini.varadhan@sun.com
* ripd/ripd.c: rip_output_process() fixup aspects of split-horizon route suppression. See [quagga-dev 429].
Diffstat (limited to 'ripd')
-rw-r--r--ripd/ripd.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index df6cf6cf..29e70c44 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -2119,9 +2119,20 @@ rip_output_process (struct interface *ifp, struct prefix *ifaddr,
/* if (split_horizon == rip_split_horizon) */
if (ri->split_horizon == RIP_SPLIT_HORIZON)
{
- /* We perform split horizon for RIP and connected route. */
- if ((rinfo->type == ZEBRA_ROUTE_RIP ||
- rinfo->type == ZEBRA_ROUTE_CONNECT) &&
+ /*
+ * We perform split horizon for RIP and connected route.
+ * For rip routes, we want to suppress the route if we would
+ * end up sending the route back on the interface that we
+ * learned it from, with a higher metric. For connected routes,
+ * we suppress the route if the prefix is a subset of the
+ * source address that we are going to use for the packet
+ * (in order to handle the case when multiple subnets are
+ * configured on the same interface).
+ */
+ if (rinfo->type == ZEBRA_ROUTE_RIP &&
+ rinfo->ifindex == ifp->ifindex)
+ continue;
+ if (rinfo->type == ZEBRA_ROUTE_CONNECT &&
prefix_match((struct prefix *)p, (struct prefix *)saddr))
continue;
}
@@ -2206,10 +2217,22 @@ rip_output_process (struct interface *ifp, struct prefix *ifaddr,
* for RIP and connected routes.
**/
if (ri->split_horizon == RIP_SPLIT_HORIZON_POISONED_REVERSE) {
- if ((rinfo->type == ZEBRA_ROUTE_RIP ||
- rinfo->type == ZEBRA_ROUTE_CONNECT) &&
+ /*
+ * We perform split horizon for RIP and connected route.
+ * For rip routes, we want to suppress the route if we would
+ * end up sending the route back on the interface that we
+ * learned it from, with a higher metric. For connected routes,
+ * we suppress the route if the prefix is a subset of the
+ * source address that we are going to use for the packet
+ * (in order to handle the case when multiple subnets are
+ * configured on the same interface).
+ */
+ if (rinfo->type == ZEBRA_ROUTE_RIP &&
rinfo->ifindex == ifp->ifindex)
rinfo->metric_out = RIP_METRIC_INFINITY;
+ if (rinfo->type == ZEBRA_ROUTE_CONNECT &&
+ prefix_match((struct prefix *)p, (struct prefix *)saddr))
+ rinfo->metric_out = RIP_METRIC_INFINITY;
}
/* Write RTE to the stream. */