summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eigrpd/eigrp_northbound.c9
-rw-r--r--eigrpd/eigrp_structs.h2
-rw-r--r--eigrpd/eigrpd.c9
-rw-r--r--eigrpd/eigrpd.h2
4 files changed, 13 insertions, 9 deletions
diff --git a/eigrpd/eigrp_northbound.c b/eigrpd/eigrp_northbound.c
index 5f0c91809..3e50d018b 100644
--- a/eigrpd/eigrp_northbound.c
+++ b/eigrpd/eigrp_northbound.c
@@ -85,7 +85,8 @@ static int eigrpd_instance_create(enum nb_event event,
/* NOTHING */
break;
case NB_EV_PREPARE:
- eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"));
+ eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"),
+ VRF_DEFAULT);
resource->ptr = eigrp;
break;
case NB_EV_ABORT:
@@ -1181,7 +1182,8 @@ static int lib_interface_eigrp_instance_create(enum nb_event event,
break;
}
- eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"));
+ eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"),
+ VRF_DEFAULT);
eif = eigrp_interface_lookup(eigrp, ifp->name);
if (eif == NULL)
return NB_ERR_INCONSISTENCY;
@@ -1192,7 +1194,8 @@ static int lib_interface_eigrp_instance_create(enum nb_event event,
break;
case NB_EV_APPLY:
ifp = nb_running_get_entry(dnode, NULL, true);
- eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"));
+ eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"),
+ VRF_DEFAULT);
eif = eigrp_interface_lookup(eigrp, ifp->name);
if (eif == NULL)
return NB_ERR_INCONSISTENCY;
diff --git a/eigrpd/eigrp_structs.h b/eigrpd/eigrp_structs.h
index 1b9186f01..848fc4f2b 100644
--- a/eigrpd/eigrp_structs.h
+++ b/eigrpd/eigrp_structs.h
@@ -69,6 +69,8 @@ struct eigrp_metrics {
};
struct eigrp {
+ vrf_id_t vrf_id;
+
uint16_t AS; /* Autonomous system number */
uint16_t vrid; /* Virtual Router ID */
uint8_t k_values[6]; /*Array for K values configuration*/
diff --git a/eigrpd/eigrpd.c b/eigrpd/eigrpd.c
index 93f8b6f90..1eacb456f 100644
--- a/eigrpd/eigrpd.c
+++ b/eigrpd/eigrpd.c
@@ -64,8 +64,6 @@ static struct eigrp_master eigrp_master;
struct eigrp_master *eigrp_om;
-static struct eigrp *eigrp_new(const char *);
-
extern struct zclient *zclient;
extern struct in_addr router_id_zebra;
@@ -136,12 +134,13 @@ void eigrp_master_init(void)
}
/* Allocate new eigrp structure. */
-static struct eigrp *eigrp_new(const char *AS)
+static struct eigrp *eigrp_new(const char *AS, vrf_id_t vrf_id)
{
struct eigrp *eigrp = XCALLOC(MTYPE_EIGRP_TOP, sizeof(struct eigrp));
int eigrp_socket;
/* init information relevant to peers */
+ eigrp->vrf_id = vrf_id;
eigrp->vrid = 0;
eigrp->AS = atoi(AS);
eigrp->router_id.s_addr = 0;
@@ -217,13 +216,13 @@ static struct eigrp *eigrp_new(const char *AS)
return eigrp;
}
-struct eigrp *eigrp_get(const char *AS)
+struct eigrp *eigrp_get(const char *AS, vrf_id_t vrf_id)
{
struct eigrp *eigrp;
eigrp = eigrp_lookup();
if (eigrp == NULL) {
- eigrp = eigrp_new(AS);
+ eigrp = eigrp_new(AS, vrf_id);
listnode_add(eigrp_om->eigrp, eigrp);
}
diff --git a/eigrpd/eigrpd.h b/eigrpd/eigrpd.h
index 3ef3a9c0c..aab81e4a7 100644
--- a/eigrpd/eigrpd.h
+++ b/eigrpd/eigrpd.h
@@ -48,7 +48,7 @@ extern void eigrp_master_init(void);
extern void eigrp_terminate(void);
extern void eigrp_finish_final(struct eigrp *);
extern void eigrp_finish(struct eigrp *);
-extern struct eigrp *eigrp_get(const char *);
+extern struct eigrp *eigrp_get(const char *as, vrf_id_t vrf_id);
extern struct eigrp *eigrp_lookup(void);
extern void eigrp_router_id_update(struct eigrp *);