]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Set bgp default nexthop value of IPv6 3509/head
authorFaicker Mo <faicker.mo@ucloud.cn>
Wed, 27 Mar 2019 10:41:57 +0000 (18:41 +0800)
committerFaicker Mo <faicker.mo@ucloud.cn>
Fri, 31 May 2019 03:37:04 +0000 (11:37 +0800)
Set the bgp default nexthop value of IPv6 to the local ipv6 addr of the
tcp connection like IPv4. Fixed the problem of route with empty nexthop
advertised to the peer when zebra is not running.

* bgp_zebra.c: (bgp_zebra_nexthop_set) Set IPv6 bgp default nexthop value.

Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
bgpd/bgp_zebra.c

index 5e9fc57f59aeeb5edab641a4b3e8f839d31b1c1c..c0f2dfca176c709cb020e70e4957459719c7d679 100644 (file)
@@ -793,6 +793,7 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
                                                      peer->bgp->vrf_id);
        }
        if (local->sa.sa_family == AF_INET6) {
+               memcpy(&nexthop->v6_global, &local->sin6.sin6_addr, IPV6_MAX_BYTELEN);
                if (IN6_IS_ADDR_LINKLOCAL(&local->sin6.sin6_addr)) {
                        if (peer->conf_if || peer->ifname)
                                ifp = if_lookup_by_name(peer->conf_if