summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2017-08-25 22:51:12 +0200
committerChirag Shah <chirag@cumulusnetworks.com>2017-10-03 18:15:19 +0200
commitb5a8894de6454e1dc0b75e1d676c5ed0fcf3438b (patch)
tree8da7790f9c160dc34874e260a910f0886b24e79c /ospfd/ospf_interface.c
parentMerge pull request #1278 from chiragshah6/ospf_vrf_dev (diff)
downloadfrr-b5a8894de6454e1dc0b75e1d676c5ed0fcf3438b.tar.xz
frr-b5a8894de6454e1dc0b75e1d676c5ed0fcf3438b.zip
ospfd: OSPFv2 VRF Support
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 422e1a2a6..b623b173c 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -243,6 +243,11 @@ struct ospf_interface *ospf_if_new(struct ospf *ospf, struct interface *ifp,
oi->ospf = ospf;
QOBJ_REG(oi, ospf_interface);
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug("%s: ospf interface %s vrf %s id %u created",
+ __PRETTY_FUNCTION__, ifp->name,
+ ospf_vrf_id_to_name(ospf->vrf_id), ospf->vrf_id);
+
return oi;
}
@@ -313,6 +318,12 @@ void ospf_if_free(struct ospf_interface *oi)
list_free(oi->ls_ack);
list_free(oi->ls_ack_direct.ls_ack);
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug("%s: ospf interface %s vrf %s id %u deleted",
+ __PRETTY_FUNCTION__, oi->ifp->name,
+ ospf_vrf_id_to_name(oi->ifp->vrf_id),
+ oi->ifp->vrf_id);
+
ospf_delete_from_if(oi->ifp, oi);
listnode_delete(oi->ospf->oiflist, oi);
@@ -335,7 +346,11 @@ struct ospf_interface *ospf_if_exists(struct ospf_interface *oic)
struct ospf *ospf;
struct ospf_interface *oi;
- if ((ospf = ospf_lookup()) == NULL)
+ if (!oic)
+ return NULL;
+
+ ospf = oic->ospf;
+ if (ospf == NULL)
return NULL;
for (ALL_LIST_ELEMENTS_RO(ospf->oiflist, node, oi))
@@ -800,10 +815,11 @@ struct ospf_interface *ospf_vl_new(struct ospf *ospf,
}
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("ospf_vl_new(): creating pseudo zebra interface");
+ zlog_debug("ospf_vl_new(): creating pseudo zebra interface vrf id %u",
+ ospf->vrf_id);
snprintf(ifname, sizeof(ifname), "VLINK%d", vlink_count);
- vi = if_create(ifname, strnlen(ifname, sizeof(ifname)), VRF_DEFAULT);
+ vi = if_create(ifname, strnlen(ifname, sizeof(ifname)), ospf->vrf_id);
/*
* if_create sets ZEBRA_INTERFACE_LINKDETECTION
* virtual links don't need this.