]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Prep commit to cleanup indentation
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 20 Oct 2018 00:38:03 +0000 (20:38 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 20 Oct 2018 00:38:03 +0000 (20:38 -0400)
Signed-off-by: Donald Sharp <sahrpd@cumulusnetworks.com>
bgpd/bgp_routemap.c

index d468d48d866cd9cbbb82995bd8d7f7a2f245ccf4..1b2c1306f72447f860869ae02b5fefb6039c9c87 100644 (file)
@@ -1403,45 +1403,42 @@ static route_map_result_t route_set_ip_nexthop(void *rule,
        struct bgp_path_info *path;
        struct peer *peer;
 
-       if (type == RMAP_BGP) {
-               path = object;
-               peer = path->peer;
+       if (type != RMAP_BGP)
+               return RMAP_OKAY;
 
-               if (rins->unchanged) {
-                       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) {
-                               path->attr->nexthop.s_addr =
-                                       sockunion2ip(peer->su_remote);
-                               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
-                                * 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 = object;
+       peer = path->peer;
+
+       if (rins->unchanged) {
+               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) {
+                       path->attr->nexthop.s_addr =
+                               sockunion2ip(peer->su_remote);
                        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,
-                                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);
+                                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->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;