diff options
author | hasso <hasso> | 2005-08-27 06:19:39 +0000 |
---|---|---|
committer | hasso <hasso> | 2005-08-27 06:19:39 +0000 |
commit | deba35508e28a3861bb182218bb51af6769b2581 (patch) | |
tree | 04613ed5ea108b58fcc83bf6abd403ed6b841f2f | |
parent | be61c4eb59b8df1aab496176d87bb2e1763f185e (diff) |
* ripng_zebra.c, ripngd.[ch]: Pass metric info to the zebra daemon.
Forwardport from stable branch.
-rw-r--r-- | ripngd/ChangeLog | 4 | ||||
-rw-r--r-- | ripngd/ripng_zebra.c | 6 | ||||
-rw-r--r-- | ripngd/ripngd.c | 9 | ||||
-rw-r--r-- | ripngd/ripngd.h | 2 |
4 files changed, 14 insertions, 7 deletions
diff --git a/ripngd/ChangeLog b/ripngd/ChangeLog index 8f874e0e..84c3ea0a 100644 --- a/ripngd/ChangeLog +++ b/ripngd/ChangeLog @@ -1,3 +1,7 @@ +2005-08-27 Hasso Tepper <hasso at quagga.net> + + * ripng_zebra.c, ripngd.[ch]: Pass metric info to the zebra daemon. + 2005-04-11 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * ripng_zebra.c (ripng_redistribute_unset, ripng_redistribute_clean): diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index 51e73a01..7744fd55 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -44,7 +44,7 @@ int ripng_interface_address_delete (int, struct zclient *, zebra_size_t); void ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop, - unsigned int ifindex) + unsigned int ifindex, u_char metric) { struct zapi_ipv6 api; @@ -59,7 +59,9 @@ ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop, SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX); api.ifindex_num = 1; api.ifindex = &ifindex; - + SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); + api.metric = metric; + zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, p, &api); } } diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 453637c3..cf0d5784 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -783,7 +783,8 @@ ripng_route_process (struct rte *rte, struct sockaddr_in6 *from, rinfo->type = ZEBRA_ROUTE_RIPNG; rinfo->sub_type = RIPNG_ROUTE_RTE; - ripng_zebra_ipv6_add (&p, &rinfo->nexthop, rinfo->ifindex); + ripng_zebra_ipv6_add (&p, &rinfo->nexthop, rinfo->ifindex, + rinfo->metric); rinfo->flags |= RIPNG_RTF_FIB; /* Aggregate check. */ @@ -835,9 +836,9 @@ ripng_route_process (struct rte *rte, struct sockaddr_in6 *from, RIPNG_TIMER_OFF (rinfo->t_garbage_collect); if (! IPV6_ADDR_SAME (&rinfo->nexthop, nexthop)) - IPV6_ADDR_COPY (&rinfo->nexthop, nexthop); + IPV6_ADDR_COPY (&rinfo->nexthop, nexthop); - ripng_zebra_ipv6_add (&p, nexthop, ifp->ifindex); + ripng_zebra_ipv6_add (&p, nexthop, ifp->ifindex, rinfo->metric); rinfo->flags |= RIPNG_RTF_FIB; /* The aggregation counter needs to be updated because @@ -850,7 +851,7 @@ ripng_route_process (struct rte *rte, struct sockaddr_in6 *from, if (oldmetric != RIPNG_METRIC_INFINITY) { ripng_zebra_ipv6_delete (&p, &rinfo->nexthop, rinfo->ifindex); - ripng_zebra_ipv6_add (&p, nexthop, ifp->ifindex); + ripng_zebra_ipv6_add (&p, nexthop, ifp->ifindex, rinfo->metric); rinfo->flags |= RIPNG_RTF_FIB; if (! IPV6_ADDR_SAME (&rinfo->nexthop, nexthop)) diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h index 68da71da..b478e9bc 100644 --- a/ripngd/ripngd.h +++ b/ripngd/ripngd.h @@ -383,7 +383,7 @@ void ripng_redistribute_withdraw (int type); void ripng_distribute_update_interface (struct interface *); void ripng_if_rmap_update_interface (struct interface *); -void ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop, unsigned int ifindex); +void ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop, unsigned int ifindex, u_char metric); void ripng_zebra_ipv6_delete (struct prefix_ipv6 *p, struct in6_addr *nexthop, unsigned int ifindex); void ripng_redistribute_clean (); |