mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 05:42:21 +00:00
bgpd: Prep commit to cleanup indentation
Signed-off-by: Donald Sharp <sahrpd@cumulusnetworks.com>
This commit is contained in:
parent
440c39acfa
commit
2b67b6f15a
@ -1403,45 +1403,42 @@ static route_map_result_t route_set_ip_nexthop(void *rule,
|
|||||||
struct bgp_path_info *path;
|
struct bgp_path_info *path;
|
||||||
struct peer *peer;
|
struct peer *peer;
|
||||||
|
|
||||||
if (type == RMAP_BGP) {
|
if (type != RMAP_BGP)
|
||||||
path = object;
|
return RMAP_OKAY;
|
||||||
peer = path->peer;
|
|
||||||
|
|
||||||
if (rins->unchanged) {
|
path = object;
|
||||||
SET_FLAG(path->attr->rmap_change_flags,
|
peer = path->peer;
|
||||||
BATTR_RMAP_NEXTHOP_UNCHANGED);
|
|
||||||
} else if (rins->peer_address) {
|
if (rins->unchanged) {
|
||||||
if ((CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)
|
SET_FLAG(path->attr->rmap_change_flags,
|
||||||
|| CHECK_FLAG(peer->rmap_type,
|
BATTR_RMAP_NEXTHOP_UNCHANGED);
|
||||||
PEER_RMAP_TYPE_IMPORT))
|
} else if (rins->peer_address) {
|
||||||
&& peer->su_remote
|
if ((CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)
|
||||||
&& sockunion_family(peer->su_remote) == AF_INET) {
|
|| CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IMPORT))
|
||||||
path->attr->nexthop.s_addr =
|
&& peer->su_remote
|
||||||
sockunion2ip(peer->su_remote);
|
&& sockunion_family(peer->su_remote) == AF_INET) {
|
||||||
path->attr->flag |=
|
path->attr->nexthop.s_addr =
|
||||||
ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
|
sockunion2ip(peer->su_remote);
|
||||||
} else if (CHECK_FLAG(peer->rmap_type,
|
|
||||||
PEER_RMAP_TYPE_OUT)) {
|
|
||||||
/* The next hop value will be set as part of
|
|
||||||
* packet rewrite.
|
|
||||||
* Set the flags here to indicate that rewrite
|
|
||||||
* needs to be done.
|
|
||||||
* Also, clear the value.
|
|
||||||
*/
|
|
||||||
SET_FLAG(path->attr->rmap_change_flags,
|
|
||||||
BATTR_RMAP_NEXTHOP_PEER_ADDRESS);
|
|
||||||
path->attr->nexthop.s_addr = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Set next hop value. */
|
|
||||||
path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
|
path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
|
||||||
path->attr->nexthop = *rins->address;
|
} else if (CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_OUT)) {
|
||||||
|
/* The next hop value will be set as part of
|
||||||
|
* packet rewrite. Set the flags here to indicate
|
||||||
|
* that rewrite needs to be done.
|
||||||
|
* Also, clear the value.
|
||||||
|
*/
|
||||||
SET_FLAG(path->attr->rmap_change_flags,
|
SET_FLAG(path->attr->rmap_change_flags,
|
||||||
BATTR_RMAP_IPV4_NHOP_CHANGED);
|
BATTR_RMAP_NEXTHOP_PEER_ADDRESS);
|
||||||
/* case for MP-BGP : MPLS VPN */
|
path->attr->nexthop.s_addr = 0;
|
||||||
path->attr->mp_nexthop_global_in = *rins->address;
|
|
||||||
path->attr->mp_nexthop_len = sizeof(*rins->address);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* Set next hop value. */
|
||||||
|
path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
|
||||||
|
path->attr->nexthop = *rins->address;
|
||||||
|
SET_FLAG(path->attr->rmap_change_flags,
|
||||||
|
BATTR_RMAP_IPV4_NHOP_CHANGED);
|
||||||
|
/* case for MP-BGP : MPLS VPN */
|
||||||
|
path->attr->mp_nexthop_global_in = *rins->address;
|
||||||
|
path->attr->mp_nexthop_len = sizeof(*rins->address);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RMAP_OKAY;
|
return RMAP_OKAY;
|
||||||
|
Loading…
Reference in New Issue
Block a user