]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: fix compilation issue with bgpd
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 18 Dec 2017 11:33:29 +0000 (12:33 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 22 Jan 2018 12:52:24 +0000 (13:52 +0100)
Changes due to the change of vrf_id_t moved from 16 bits to 32 bits.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_bfd.c
bgpd/bgp_main.c
bgpd/bgp_nht.c
bgpd/bgp_route.c
bgpd/bgp_vty.c

index 2e277bfa5ff6909960e020fa2215064cea8984dd..ce46b21f03d1be51d1de1224ff43c6184c4bae56 100644 (file)
@@ -302,13 +302,13 @@ static int bgp_bfd_dest_update(int command, struct zclient *zclient,
                prefix2str(&dp, buf[0], sizeof(buf[0]));
                if (ifp) {
                        zlog_debug(
-                               "Zebra: vrf %d interface %s bfd destination %s %s",
+                               "Zebra: vrf %u interface %s bfd destination %s %s",
                                vrf_id, ifp->name, buf[0],
                                bfd_get_status_str(status));
                } else {
                        prefix2str(&sp, buf[1], sizeof(buf[1]));
                        zlog_debug(
-                               "Zebra: vrf %d source %s bfd destination %s %s",
+                               "Zebra: vrf %u source %s bfd destination %s %s",
                                vrf_id, buf[1], buf[0],
                                bfd_get_status_str(status));
                }
index a720d31a766db621117418f8ac2caf12648edd38..0508f4846de40d5933d3cbe3ecb7984399c8e74a 100644 (file)
@@ -232,7 +232,7 @@ static __attribute__((__noreturn__)) void bgp_exit(int status)
 static int bgp_vrf_new(struct vrf *vrf)
 {
        if (BGP_DEBUG(zebra, ZEBRA))
-               zlog_debug("VRF Created: %s(%d)", vrf->name, vrf->vrf_id);
+               zlog_debug("VRF Created: %s(%u)", vrf->name, vrf->vrf_id);
 
        return 0;
 }
@@ -240,7 +240,7 @@ static int bgp_vrf_new(struct vrf *vrf)
 static int bgp_vrf_delete(struct vrf *vrf)
 {
        if (BGP_DEBUG(zebra, ZEBRA))
-               zlog_debug("VRF Deletion: %s(%d)", vrf->name, vrf->vrf_id);
+               zlog_debug("VRF Deletion: %s(%u)", vrf->name, vrf->vrf_id);
 
        return 0;
 }
@@ -251,7 +251,7 @@ static int bgp_vrf_enable(struct vrf *vrf)
        vrf_id_t old_vrf_id;
 
        if (BGP_DEBUG(zebra, ZEBRA))
-               zlog_debug("VRF enable add %s id %d", vrf->name, vrf->vrf_id);
+               zlog_debug("VRF enable add %s id %u", vrf->name, vrf->vrf_id);
 
        bgp = bgp_lookup_by_name(vrf->name);
        if (bgp) {
index 625d4f844260d03bb0c58977f7b2a979d074d974..247884d2948b15fe7457d7efe42161b35d9ba5ba 100644 (file)
@@ -336,7 +336,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
        bgp = bgp_lookup_by_vrf_id(vrf_id);
        if (!bgp) {
                zlog_err(
-                       "parse nexthop update: instance not found for vrf_id %d",
+                       "parse nexthop update: instance not found for vrf_id %u",
                        vrf_id);
                return;
        }
@@ -389,7 +389,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
                char buf[PREFIX2STR_BUFFER];
                prefix2str(&p, buf, sizeof(buf));
                zlog_debug(
-                       "%d: Rcvd NH update %s - metric %d/%d #nhops %d/%d flags 0x%x",
+                       "%u: Rcvd NH update %s - metric %d/%d #nhops %d/%d flags 0x%x",
                        vrf_id, buf, metric, bnc->metric, nexthop_num,
                        bnc->nexthop_num, bnc->flags);
        }
index 061f5fb1e2dfb1662cebf4ebea57f09596918449..c7901f30dcb4fb83ffc7ded1f97045228618478a 100644 (file)
@@ -7859,7 +7859,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                vty_out(vty,
                        "{\n \"vrfId\": %d,\n \"vrfName\": \"%s\",\n \"tableVersion\": %" PRId64
                        ",\n \"routerId\": \"%s\",\n \"routes\": { ",
-                       bgp->vrf_id == VRF_UNKNOWN ? -1 : bgp->vrf_id,
+                       bgp->vrf_id == VRF_UNKNOWN ? -1 : (int)bgp->vrf_id,
                        bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT ? "Default"
                                                                    : bgp->name,
                        table->version, inet_ntoa(bgp->router_id));
index 19cfb2d91d2c2078d5aefe70b9024ad17ae565e9..c98cf9c327d7723e2c1ce22368588b364253b96d 100644 (file)
@@ -6479,7 +6479,6 @@ DEFUN (show_bgp_vrfs,
                struct listnode *node, *nnode;
                int peers_cfg, peers_estb;
                json_object *json_vrf = NULL;
-               int vrf_id_ui;
 
                /* Skip Views. */
                if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
@@ -6513,8 +6512,10 @@ DEFUN (show_bgp_vrfs,
                        type = "VRF";
                }
 
-               vrf_id_ui = (bgp->vrf_id == VRF_UNKNOWN) ? -1 : bgp->vrf_id;
+
                if (uj) {
+                       int64_t vrf_id_ui = (bgp->vrf_id == VRF_UNKNOWN) ? -1 :
+                               (int64_t)bgp->vrf_id;
                        json_object_string_add(json_vrf, "type", type);
                        json_object_int_add(json_vrf, "vrfId", vrf_id_ui);
                        json_object_string_add(json_vrf, "routerId",
@@ -6532,7 +6533,9 @@ DEFUN (show_bgp_vrfs,
                } else
                        vty_out(vty,
                                "%4s  %-5d  %-16s  %9u  %10u  %-37s %-10u %-15s\n",
-                               type, vrf_id_ui, inet_ntoa(bgp->router_id),
+                               type, bgp->vrf_id == VRF_UNKNOWN ?
+                               -1 : (int)bgp->vrf_id,
+                               inet_ntoa(bgp->router_id),
                                peers_cfg, peers_estb, name, bgp->l3vni,
                                prefix_mac2str(&bgp->rmac, buf, sizeof(buf)));
        }
@@ -6852,10 +6855,11 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                if (!count) {
                        unsigned long ents;
                        char memstrbuf[MTYPE_MEMSTR_LEN];
-                       int vrf_id_ui;
+                       int64_t vrf_id_ui;
 
                        vrf_id_ui =
-                               (bgp->vrf_id == VRF_UNKNOWN) ? -1 : bgp->vrf_id;
+                               (bgp->vrf_id == VRF_UNKNOWN) ? -1 :
+                               (int64_t)bgp->vrf_id;
 
                        /* Usage summary and header */
                        if (use_json) {
@@ -6874,7 +6878,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                vty_out(vty,
                                        "BGP router identifier %s, local AS number %u vrf-id %d",
                                        inet_ntoa(bgp->router_id), bgp->as,
-                                       vrf_id_ui);
+                                       bgp->vrf_id == VRF_UNKNOWN ? -1 :
+                                       (int)bgp->vrf_id);
                                vty_out(vty, "\n");
                        }
 
@@ -9876,8 +9881,7 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty,
 
                        json_object_int_add(json, "vrfId",
                                            (bgp->vrf_id == VRF_UNKNOWN)
-                                                   ? -1
-                                                   : bgp->vrf_id);
+                                           ? -1 : (int64_t) bgp->vrf_id);
                        json_object_string_add(
                                json, "vrfName",
                                (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)