diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-12-06 14:51:10 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2012-01-02 17:15:19 +0400 |
commit | 840faaeb00f1617649332dad82952e21e7c7fda7 (patch) | |
tree | 571cda4238b579ce571bf17cc42423fa12b9ba06 /bgpd/bgp_route.c | |
parent | 4fafd3deef6eecab229e8b35189ffbc1f1ce9806 (diff) |
bgpd: store nexthop info for redistributed IPV6 routes
BGP was ignoring nexthop info for static and other redistributed
routes for IPv6. Build extra attribute info to store the nexthop.
See also:
https://bugzilla.vyatta.com/show_bug.cgi?id=6073
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index b7716330..98e49bcd 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5238,7 +5238,8 @@ ALIAS (no_ipv6_aggregate_address_summary_only, /* Redistribute route treatment. */ void -bgp_redistribute_add (struct prefix *p, struct in_addr *nexthop, +bgp_redistribute_add (struct prefix *p, const struct in_addr *nexthop, + const struct in6_addr *nexthop6, u_int32_t metric, u_char type) { struct bgp *bgp; @@ -5258,6 +5259,15 @@ bgp_redistribute_add (struct prefix *p, struct in_addr *nexthop, if (nexthop) attr.nexthop = *nexthop; +#ifdef HAVE_IPV6 + if (nexthop6) + { + struct attr_extra *extra = bgp_attr_extra_get(&attr); + extra->mp_nexthop_global = *nexthop6; + extra->mp_nexthop_len = 16; + } +#endif + attr.med = metric; attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC); |