summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_routemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r--bgpd/bgp_routemap.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index f0bc84ce3..d8d1fa5dd 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2066,10 +2066,9 @@ route_set_ip_nexthop(void *rule, const struct prefix *prefix, void *object)
BATTR_RMAP_NEXTHOP_UNCHANGED);
} else if (rins->peer_address) {
if ((CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)) &&
- peer->su_remote &&
- sockunion_family(peer->su_remote) == AF_INET) {
- path->attr->nexthop.s_addr =
- sockunion2ip(peer->su_remote);
+ peer->connection->su_remote &&
+ sockunion_family(peer->connection->su_remote) == AF_INET) {
+ path->attr->nexthop.s_addr = sockunion2ip(peer->connection->su_remote);
SET_FLAG(path->attr->flag, ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP));
} else if (CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_OUT)) {
/* The next hop value will be set as part of
@@ -4143,9 +4142,9 @@ route_set_ipv6_nexthop_peer(void *rule, const struct prefix *pfx, void *object)
path = object;
peer = path->peer;
- if ((CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)) &&
- peer->su_remote && sockunion_family(peer->su_remote) == AF_INET6) {
- peer_address = peer->su_remote->sin6.sin6_addr;
+ if ((CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)) && peer->connection->su_remote &&
+ sockunion_family(peer->connection->su_remote) == AF_INET6) {
+ peer_address = peer->connection->su_remote->sin6.sin6_addr;
/* Set next hop value and length in attribute. */
if (IN6_IS_ADDR_LINKLOCAL(&peer_address)) {
path->attr->mp_nexthop_local = peer_address;