diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-06-12 17:47:26 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-06-21 14:56:56 +0100 |
commit | 7f56743f7d4b3dcdae329de2de2aba820368c3d9 (patch) | |
tree | 22f257e60e1bf6361f35b89307d51a82554e2339 | |
parent | b1891fb9705b6085f81269dec0795f2065442047 (diff) | |
download | quagga-7f56743f7d4b3dcdae329de2de2aba820368c3d9.tar.bz2 quagga-7f56743f7d4b3dcdae329de2de2aba820368c3d9.tar.xz |
pimd assert when no route to source from a new igmp join
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>
-rw-r--r-- | pimd/pim_upstream.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index d02f9154..a4d274ab 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -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); |