summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_routemap.c17
-rw-r--r--bgpd/bgpd.h7
2 files changed, 8 insertions, 16 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index d0b65a7426..d37b171063 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -1992,10 +1992,9 @@ route_set_ip_nexthop(void *rule, const struct prefix *prefix, void *object)
SET_FLAG(path->attr->rmap_change_flags,
BATTR_RMAP_NEXTHOP_UNCHANGED);
} else if (rins->peer_address) {
- if ((CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)
- || CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IMPORT))
- && peer->su_remote
- && sockunion_family(peer->su_remote) == AF_INET) {
+ 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);
path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
@@ -3950,8 +3949,7 @@ route_set_ipv6_nexthop_prefer_global(void *rule, const struct prefix *prefix,
path = object;
peer = path->peer;
- if (CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)
- || CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IMPORT)) {
+ if (CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN)) {
/* Set next hop preference to global */
SET_FLAG(path->attr->nh_flags, BGP_ATTR_NH_MP_PREFER_GLOBAL);
SET_FLAG(path->attr->rmap_change_flags,
@@ -4077,10 +4075,8 @@ 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)
- || CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IMPORT))
- && peer->su_remote
- && sockunion_family(peer->su_remote) == AF_INET6) {
+ 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;
/* Set next hop value and length in attribute. */
if (IN6_IS_ADDR_LINKLOCAL(&peer_address)) {
@@ -4095,7 +4091,6 @@ route_set_ipv6_nexthop_peer(void *rule, const struct prefix *pfx, void *object)
path->attr->mp_nexthop_len =
BGP_ATTR_NHLEN_IPV6_GLOBAL;
}
-
} else if (CHECK_FLAG(peer->rmap_type, PEER_RMAP_TYPE_OUT)) {
/* The next hop value will be set as part of packet
* rewrite.
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 7d0810c84e..def12ee642 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1828,16 +1828,13 @@ struct peer {
struct stream *last_reset_cause;
/* The kind of route-map Flags.*/
- uint16_t rmap_type;
+ uint8_t rmap_type;
#define PEER_RMAP_TYPE_IN (1U << 0) /* neighbor route-map in */
#define PEER_RMAP_TYPE_OUT (1U << 1) /* neighbor route-map out */
#define PEER_RMAP_TYPE_NETWORK (1U << 2) /* network route-map */
#define PEER_RMAP_TYPE_REDISTRIBUTE (1U << 3) /* redistribute route-map */
#define PEER_RMAP_TYPE_DEFAULT (1U << 4) /* default-originate route-map */
-#define PEER_RMAP_TYPE_NOSET (1U << 5) /* not allow to set commands */
-#define PEER_RMAP_TYPE_IMPORT (1U << 6) /* neighbor route-map import */
-#define PEER_RMAP_TYPE_EXPORT (1U << 7) /* neighbor route-map export */
-#define PEER_RMAP_TYPE_AGGREGATE (1U << 8) /* aggregate-address route-map */
+#define PEER_RMAP_TYPE_AGGREGATE (1U << 5) /* aggregate-address route-map */
/** Peer overwrite configuration. */
struct bfd_session_config {