From fe3da9e7735d0fc8dc25d90b87be60c28fe66a5c Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 18 Dec 2017 12:07:22 +0100 Subject: [PATCH] ospfd: fix compilation issue with ospfd the change of vrf_id field from 16 bit to 32 bit leads to some changes in other daemon. Signed-off-by: Philippe Guibert --- ospfd/ospf_vty.c | 7 ++++--- ospfd/ospfd.c | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index e2aa445572..6d28c2cdc5 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -218,7 +218,7 @@ DEFUN_NOSH (router_ospf, if (ospf->vrf_id != VRF_UNKNOWN) ospf->oi_running = 1; if (IS_DEBUG_OSPF_EVENT) - zlog_debug("Config command 'router ospf %d' received, vrf %s id %d oi_running %u", + zlog_debug("Config command 'router ospf %d' received, vrf %s id %u oi_running %u", instance, ospf->name ? ospf->name : "NIL", ospf->vrf_id, ospf->oi_running); VTY_PUSH_CONTEXT(OSPF_NODE, ospf); @@ -9600,7 +9600,7 @@ DEFUN (show_ip_ospf_vrfs, for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) { json_object *json_vrf = NULL; const char *name = NULL; - int vrf_id_ui = 0; + int64_t vrf_id_ui = 0; count++; @@ -9614,7 +9614,8 @@ DEFUN (show_ip_ospf_vrfs, else name = ospf->name; - vrf_id_ui = (ospf->vrf_id == VRF_UNKNOWN) ? -1 : ospf->vrf_id; + vrf_id_ui = (ospf->vrf_id == VRF_UNKNOWN) ? -1 : + (int64_t) ospf->vrf_id; if (uj) { json_object_int_add(json_vrf, "vrfId", vrf_id_ui); diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 862e87e40f..6d583e9b4a 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -240,7 +240,7 @@ static struct ospf *ospf_new(u_short instance, const char *name) new->name = XSTRDUP(MTYPE_OSPF_TOP, name); vrf = vrf_lookup_by_name(new->name); if (IS_DEBUG_OSPF_EVENT) - zlog_debug("%s: Create new ospf instance with vrf_name %s vrf_id %d", + zlog_debug("%s: Create new ospf instance with vrf_name %s vrf_id %u", __PRETTY_FUNCTION__, name, new->vrf_id); if (vrf) ospf_vrf_link(new, vrf); @@ -2013,7 +2013,7 @@ void ospf_vrf_unlink(struct ospf *ospf, struct vrf *vrf) static int ospf_vrf_new(struct vrf *vrf) { if (IS_DEBUG_OSPF_EVENT) - zlog_debug("%s: VRF Created: %s(%d)", __PRETTY_FUNCTION__, + zlog_debug("%s: VRF Created: %s(%u)", __PRETTY_FUNCTION__, vrf->name, vrf->vrf_id); return 0; @@ -2023,7 +2023,7 @@ static int ospf_vrf_new(struct vrf *vrf) static int ospf_vrf_delete(struct vrf *vrf) { if (IS_DEBUG_OSPF_EVENT) - zlog_debug("%s: VRF Deletion: %s(%d)", __PRETTY_FUNCTION__, + zlog_debug("%s: VRF Deletion: %s(%u)", __PRETTY_FUNCTION__, vrf->name, vrf->vrf_id); return 0; @@ -2036,7 +2036,7 @@ static int ospf_vrf_enable(struct vrf *vrf) vrf_id_t old_vrf_id = VRF_DEFAULT; if (IS_DEBUG_OSPF_EVENT) - zlog_debug("%s: VRF %s id %d enabled", + zlog_debug("%s: VRF %s id %u enabled", __PRETTY_FUNCTION__, vrf->name, vrf->vrf_id); ospf = ospf_lookup_by_name(vrf->name); @@ -2045,7 +2045,7 @@ static int ospf_vrf_enable(struct vrf *vrf) /* We have instance configured, link to VRF and make it "up". */ ospf_vrf_link(ospf, vrf); if (IS_DEBUG_OSPF_EVENT) - zlog_debug("%s: ospf linked to vrf %s vrf_id %d (old id %d)", + zlog_debug("%s: ospf linked to vrf %s vrf_id %u (old id %u)", __PRETTY_FUNCTION__, vrf->name, ospf->vrf_id, old_vrf_id);