]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Modify pim_upstream_new behavior
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 7 Dec 2016 13:15:16 +0000 (08:15 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:18 +0000 (20:26 -0500)
Modify pim_usptream_new to auto create the pim
channel oil.  Why?  Because there exists situations
where we have upstream state and we are attempting
to set the inherited_olist on it and we have
not created the channel oil yet.  When that
happens we end up with mroutes that are
being meanies.

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

index 60893c8c1078d7e24d802d0eee85112260cbec8d..53bae4d5fd46a94c74ee827d075e94e4819416ed 100644 (file)
@@ -2909,7 +2909,7 @@ static void show_mroute(struct vty *vty, u_char uj)
     struct interface *ifp_in;
     found_oif = 0;
     first = 1;
-    if (!c_oil->installed)
+    if (!c_oil->installed && !uj)
       continue;
 
     pim_inet4_dump("<group?>", c_oil->oil.mfcc_mcastgrp, grp_str, sizeof(grp_str));
@@ -2941,6 +2941,9 @@ static void show_mroute(struct vty *vty, u_char uj)
 
       /* Find the inbound interface nested under the source, create it if it doesn't exist */
       json_object_object_get_ex(json_source, in_ifname, &json_ifp_in);
+      json_object_int_add(json_source, "installed", c_oil->installed);
+      json_object_int_add(json_source, "refCount", c_oil->oil_ref_count);
+      json_object_int_add(json_source, "oilSize", c_oil->oil_size);
 
       if (!json_ifp_in) {
         json_ifp_in = json_object_new_object();
index 2b76cb91729355afc1c79a43d3f2746ceb06d39c..14508ad184a84755fe5d7b152fbebe0f2f4562e0 100644 (file)
@@ -519,12 +519,14 @@ pim_upstream_compare (void *arg1, void *arg2)
   return 0;
 }
 
-static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
-                                            struct interface *incoming,
-                                            int flags)
+static struct pim_upstream *
+pim_upstream_new (struct prefix_sg *sg,
+                 struct interface *incoming,
+                 int flags)
 {
-  struct pim_upstream *up;
   enum pim_rpf_result rpf_result;
+  struct pim_interface *pim_ifp;
+  struct pim_upstream *up;
 
   up = XCALLOC(MTYPE_PIM_UPSTREAM, sizeof(*up));
   if (!up) {
@@ -602,6 +604,10 @@ static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
     return NULL;
   }
 
+  pim_ifp = up->rpf.source_nexthop.interface->info;
+  if (pim_ifp)
+    up->channel_oil = pim_channel_oil_add(&up->sg, pim_ifp->mroute_vif_index);
+
   listnode_add_sort(pim_upstream_list, up);
 
   if (PIM_DEBUG_TRACE)