]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_fpm_netlink.c
*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
[mirror_frr.git] / zebra / zebra_fpm_netlink.c
index d5479bc627ae1ba777d636bf0ef166825995bec0..d60da336fd5b5588a926d3f6d17466a6e17fe997 100644 (file)
@@ -57,13 +57,10 @@ static inline const char *addr_to_a(uint8_t af, void *addr)
 
        case AF_INET:
                return inet_ntoa(*((struct in_addr *)addr));
-               break;
        case AF_INET6:
                return inet6_ntoa(*((struct in6_addr *)addr));
-               break;
        default:
                return "<Addr in unknown AF>";
-               break;
        }
 }
 
@@ -92,10 +89,8 @@ static size_t af_addr_size(uint8_t af)
 
        case AF_INET:
                return 4;
-               break;
        case AF_INET6:
                return 16;
-               break;
        default:
                assert(0);
                return 16;
@@ -195,7 +190,7 @@ typedef struct netlink_route_info_t_ {
  * Add information about the given nexthop to the given route info
  * structure.
  *
- * Returns TRUE if a nexthop was added, FALSE otherwise.
+ * Returns true if a nexthop was added, false otherwise.
  */
 static int netlink_route_info_add_nh(netlink_route_info_t *ri,
                                     struct nexthop *nexthop,
@@ -218,7 +213,7 @@ static int netlink_route_info_add_nh(netlink_route_info_t *ri,
        if (nexthop->type == NEXTHOP_TYPE_IPV4
            || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) {
                nhi.gateway = &nexthop->gate;
-               if (nexthop->src.ipv4.s_addr)
+               if (nexthop->src.ipv4.s_addr != INADDR_ANY)
                        src = &nexthop->src;
        }
 
@@ -228,7 +223,7 @@ static int netlink_route_info_add_nh(netlink_route_info_t *ri,
        }
 
        if (nexthop->type == NEXTHOP_TYPE_IFINDEX) {
-               if (nexthop->src.ipv4.s_addr)
+               if (nexthop->src.ipv4.s_addr != INADDR_ANY)
                        src = &nexthop->src;
        }
 
@@ -238,7 +233,7 @@ static int netlink_route_info_add_nh(netlink_route_info_t *ri,
        if (re && CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)) {
                nhi.encap_info.encap_type = FPM_NH_ENCAP_VXLAN;
 
-               zl3vni = zl3vni_from_vrf(ri->rtm_table);
+               zl3vni = zl3vni_from_vrf(nexthop->vrf_id);
                if (zl3vni && is_l3vni_oper_up(zl3vni)) {
 
                        /* Add VNI to VxLAN encap info */
@@ -278,7 +273,7 @@ static uint8_t netlink_proto_from_route_type(int type)
  *
  * Fill out the route information object from the given route.
  *
- * Returns TRUE on success and FALSE on failure.
+ * Returns true on success and false on failure.
  */
 static int netlink_route_info_fill(netlink_route_info_t *ri, int cmd,
                                   rib_dest_t *dest, struct route_entry *re)
@@ -314,7 +309,7 @@ static int netlink_route_info_fill(netlink_route_info_t *ri, int cmd,
        ri->rtm_type = RTN_UNICAST;
        ri->metric = &re->metric;
 
-       for (ALL_NEXTHOPS(re->ng, nexthop)) {
+       for (ALL_NEXTHOPS(re->nhe->nhg, nexthop)) {
                if (ri->num_nhs >= zrouter.multipath_num)
                        break;
 
@@ -575,7 +570,7 @@ int zfpm_netlink_encode_route(int cmd, rib_dest_t *dest, struct route_entry *re,
        if (!netlink_route_info_fill(ri, cmd, dest, re))
                return 0;
 
-       zfpm_log_route_info(ri, __FUNCTION__);
+       zfpm_log_route_info(ri, __func__);
 
        return netlink_route_info_encode(ri, in_buf, in_buf_len);
 }