summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 9d966a0f..084af380 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3447,6 +3447,9 @@ struct zebra_vrf *
zebra_vrf_alloc (vrf_id_t vrf_id)
{
struct zebra_vrf *zvrf;
+#ifdef HAVE_NETLINK
+ char nl_name[64];
+#endif
zvrf = XCALLOC (MTYPE_ZEBRA_VRF, sizeof (struct zebra_vrf));
@@ -3463,6 +3466,17 @@ zebra_vrf_alloc (vrf_id_t vrf_id)
/* Set VRF ID */
zvrf->vrf_id = vrf_id;
+#ifdef HAVE_NETLINK
+ /* Initialize netlink sockets */
+ snprintf (nl_name, 64, "netlink-listen (vrf %u)", vrf_id);
+ zvrf->netlink.sock = -1;
+ zvrf->netlink.name = XSTRDUP (MTYPE_NETLINK_NAME, nl_name);
+
+ snprintf (nl_name, 64, "netlink-cmd (vrf %u)", vrf_id);
+ zvrf->netlink_cmd.sock = -1;
+ zvrf->netlink_cmd.name = XSTRDUP (MTYPE_NETLINK_NAME, nl_name);
+#endif
+
return zvrf;
}