]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib, zebra: Pass up kernel table_id for vrf's
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 17 May 2017 20:20:29 +0000 (16:20 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 2 Jun 2017 17:43:15 +0000 (13:43 -0400)
pim controls the vrf table creation for due to the way that
pim must interact with the kernel.  In order to match the
table_id for unicast <-> multicast( not necessary but a
real nice to have ) we need to pass up from zebra the
table_id associated with the vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/vrf.h
lib/zclient.c
zebra/zserv.c

index fe2b4842b0e57f03b9ebf08a2bdad7887cbed166..d470349f00936ba9ac6516cb4ccddb3219759fb8 100644 (file)
--- a/lib/vrf.h
+++ b/lib/vrf.h
@@ -56,6 +56,20 @@ enum {
 #define VRF_CMD_HELP_STR    "Specify the VRF\nThe VRF name\n"
 #define VRF_ALL_CMD_HELP_STR    "Specify the VRF\nAll VRFs\n"
 
+/*
+ * Pass some OS specific data up through
+ * to the daemons
+ */
+struct vrf_data
+{
+  union
+  {
+    struct {
+      uint32_t table_id;
+    } l;
+  };
+};
+
 struct vrf
 {
   RB_ENTRY(vrf) id_entry, name_entry;
@@ -76,6 +90,9 @@ struct vrf
   /* User data */
   void *info;
 
+  /* The table_id from the kernel */
+  struct vrf_data data;
+
   QOBJ_FIELDS
 };
 RB_HEAD (vrf_id_head, vrf);
index a53e8112c82c669095a73fdd21db48be0258492a..b3a933892809e5e10bc8768df5b828eaf7fd35ef 100644 (file)
@@ -1077,12 +1077,15 @@ zclient_vrf_add (struct zclient *zclient, vrf_id_t vrf_id)
 {
   struct vrf *vrf;
   char vrfname_tmp[VRF_NAMSIZ];
+  struct vrf_data data;
 
+  stream_get (&data, zclient->ibuf, sizeof (struct vrf_data));
   /* Read interface name. */
   stream_get (vrfname_tmp, zclient->ibuf, VRF_NAMSIZ);
 
   /* Lookup/create vrf by vrf_id. */
   vrf = vrf_get (vrf_id, vrfname_tmp);
+  vrf->data = data;
 
   vrf_enable (vrf);
 }
index e93299d622e76cca16a7fb27f3e526213eee7e74..b131b208c66110bdaecbdae0438d06eaade7f96b 100644 (file)
@@ -192,6 +192,11 @@ zserv_encode_interface (struct stream *s, struct interface *ifp)
 static void
 zserv_encode_vrf (struct stream *s, struct zebra_vrf *zvrf)
 {
+  struct vrf_data data;
+
+  data.l.table_id = zvrf->table_id;
+  /* Pass the tableid */
+  stream_put (s, &data, sizeof (struct vrf_data));
   /* Interface information. */
   stream_put (s, zvrf_name (zvrf), VRF_NAMSIZ);