]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Write pim_upstream_empty_inherited_olist
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 10 Nov 2016 14:41:28 +0000 (09:41 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:14 +0000 (20:26 -0500)
A empty inherited_olist implies that we have
no outgoing interfaces.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_oil.c
pimd/pim_oil.h
pimd/pim_upstream.c

index 94165032043d8e72b22c15942451b2825100227b..acebd6ace6024d7abd04358252e7e51739d42348 100644 (file)
@@ -432,3 +432,24 @@ int pim_channel_add_oif(struct channel_oil *channel_oil,
 
   return 0;
 }
+
+int
+pim_channel_oil_empty (struct channel_oil *c_oil)
+{
+  static uint32_t zero[MAXVIFS];
+  static int inited = 0;
+
+  if (!c_oil)
+    return 1;
+  /*
+   * Not sure that this is necessary, but I would rather ensure
+   * that this works.
+   */
+  if (!inited)
+    {
+      memset(&zero, 0, sizeof(uint32_t) * MAXVIFS);
+      inited = 1;
+    }
+
+  return !memcmp(c_oil->oif_flags, zero, MAXVIFS * sizeof(uint32_t));
+}
index 0c99afb62533a8359b43cf876118dbf855ec4cdf..939ef4b3fc39958325d9c815b29afdbc4c566264 100644 (file)
@@ -95,4 +95,5 @@ int pim_channel_del_oif (struct channel_oil *c_oil,
                         struct interface *oif,
                         uint32_t proto_mask);
 
+int pim_channel_oil_empty (struct channel_oil *c_oil);
 #endif /* PIM_OIL_H */
index b3b6fdce21065e401f6e439b76a24759a3de6ac9..fe6e81ef63f68f2fff357d20a39d26ba8d4b1bb5 100644 (file)
@@ -1242,8 +1242,7 @@ pim_upstream_inherited_olist (struct pim_upstream *up)
 int
 pim_upstream_empty_inherited_olist (struct pim_upstream *up)
 {
-  // FIXME: Currently this is not implemented
-  return 0;
+  return pim_channel_oil_empty (up->channel_oil);
 }
 
 /*