mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-05 07:27:53 +00:00
Merge pull request #859 from donaldsharp/bgp_ll_global
Bgp -> Allow comparison of correct v6 nexthop
This commit is contained in:
commit
a67223a8b6
@ -102,6 +102,7 @@ int bgp_maximum_paths_unset(struct bgp *bgp, afi_t afi, safi_t safi,
|
|||||||
int bgp_info_nexthop_cmp(struct bgp_info *bi1, struct bgp_info *bi2)
|
int bgp_info_nexthop_cmp(struct bgp_info *bi1, struct bgp_info *bi2)
|
||||||
{
|
{
|
||||||
int compare;
|
int compare;
|
||||||
|
struct in6_addr addr1, addr2;
|
||||||
|
|
||||||
compare = IPV4_ADDR_CMP(&bi1->attr->nexthop, &bi2->attr->nexthop);
|
compare = IPV4_ADDR_CMP(&bi1->attr->nexthop, &bi2->attr->nexthop);
|
||||||
if (!compare) {
|
if (!compare) {
|
||||||
@ -120,13 +121,18 @@ int bgp_info_nexthop_cmp(struct bgp_info *bi1, struct bgp_info *bi2)
|
|||||||
&bi2->attr->mp_nexthop_global);
|
&bi2->attr->mp_nexthop_global);
|
||||||
break;
|
break;
|
||||||
case BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL:
|
case BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL:
|
||||||
compare = IPV6_ADDR_CMP(
|
addr1 = (bi1->attr->mp_nexthop_prefer_global) ?
|
||||||
&bi1->attr->mp_nexthop_global,
|
bi1->attr->mp_nexthop_global
|
||||||
&bi2->attr->mp_nexthop_global);
|
: bi1->attr->mp_nexthop_local;
|
||||||
|
addr2 = (bi2->attr->mp_nexthop_prefer_global) ?
|
||||||
|
bi2->attr->mp_nexthop_global
|
||||||
|
: bi2->attr->mp_nexthop_local;
|
||||||
|
|
||||||
|
if (!bi1->attr->mp_nexthop_prefer_global &&
|
||||||
|
!bi2->attr->mp_nexthop_prefer_global)
|
||||||
|
compare = !(bi1->peer->ifindex == bi2->peer->ifindex);
|
||||||
if (!compare)
|
if (!compare)
|
||||||
compare = IPV6_ADDR_CMP(
|
compare = IPV6_ADDR_CMP(&addr1, &addr2);
|
||||||
&bi1->attr->mp_nexthop_local,
|
|
||||||
&bi2->attr->mp_nexthop_local);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,8 +269,6 @@ static int bgp_interface_delete(int command, struct zclient *zclient,
|
|||||||
if (!ifp) /* This may happen if we've just unregistered for a VRF. */
|
if (!ifp) /* This may happen if we've just unregistered for a VRF. */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ifp->ifindex = IFINDEX_DELETED;
|
|
||||||
|
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("Rx Intf del VRF %u IF %s", vrf_id, ifp->name);
|
zlog_debug("Rx Intf del VRF %u IF %s", vrf_id, ifp->name);
|
||||||
|
|
||||||
@ -279,6 +277,8 @@ static int bgp_interface_delete(int command, struct zclient *zclient,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bgp_update_interface_nbrs(bgp, ifp, NULL);
|
bgp_update_interface_nbrs(bgp, ifp, NULL);
|
||||||
|
|
||||||
|
ifp->ifindex = IFINDEX_DELETED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user