]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd assert when no route to source from a new igmp join
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 13 Jun 2015 00:47:26 +0000 (17:47 -0700)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:32 +0000 (20:38 -0400)
When pim_upstream_new is called the code looks up the nexthop.
If there is no route to the source, the code silently ignored
the error returned.  When the nexthop lookup fails don't create
the 'struct pim_stream *' to return.

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

index 7bd23ffc6104a5093438f9a346f3bd80bc531c36..7957f5da46cc89a1b5906772c5db2a53b2376c34 100644 (file)
@@ -349,6 +349,7 @@ static struct pim_upstream *pim_upstream_new(struct in_addr source_addr,
                                             struct in_addr group_addr)
 {
   struct pim_upstream *up;
+  enum pim_rpf_result rpf_result;
 
   up = XMALLOC(MTYPE_PIM_UPSTREAM, sizeof(*up));
   if (!up) {
@@ -372,7 +373,11 @@ static struct pim_upstream *pim_upstream_new(struct in_addr source_addr,
   up->rpf.source_nexthop.mrib_route_metric        = qpim_infinite_assert_metric.route_metric;
   up->rpf.rpf_addr.s_addr                         = PIM_NET_INADDR_ANY;
 
-  pim_rpf_update(up, 0);
+  rpf_result = pim_rpf_update(up, 0);
+  if (rpf_result == PIM_RPF_FAILURE) {
+    XFREE(MTYPE_PIM_UPSTREAM, up);
+    return NULL;
+  }
 
   listnode_add(qpim_upstream_list, up);