/*
- PIM for Quagga
- Copyright (C) 2008 Everton da Silva Marques
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING; if not, write to the
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- MA 02110-1301 USA
-*/
+ * PIM for Quagga
+ * Copyright (C) 2008 Everton da Silva Marques
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#include <zebra.h>
#include "pim_rpf.h"
#include "pim_register.h"
#include "pim_jp_agg.h"
+#include "pim_oil.h"
void pim_msg_build_header(uint8_t *pim_msg, size_t pim_msg_size,
uint8_t pim_msg_type)
struct pim_jp_sources *js;
size_t size = 0;
+ if (!sources)
+ return 0;
+
size += sizeof(struct pim_encoded_group_ipv4);
size += 4; // Joined sources (2) + Pruned Sources (2)
size += sizeof(struct pim_encoded_source_ipv4) * sources->count;
js = listgetdata(listhead(sources));
- if (js && js->up->sg.src.s_addr == INADDR_ANY) {
+ if (js && js->up->sg.src.s_addr == INADDR_ANY && js->is_join) {
struct pim_upstream *child, *up;
struct listnode *up_node;
grp->prunes++;
if (source->up->sg.src.s_addr == INADDR_ANY) {
- struct pim_rpf *rpf = pim_rp_g(source->up->sg.grp);
+ struct pim_instance *pim = source->up->channel_oil->pim;
+ struct pim_rpf *rpf = pim_rp_g(pim, source->up->sg.grp);
bits = PIM_ENCODE_SPARSE_BIT | PIM_ENCODE_WC_BIT
| PIM_ENCODE_RPT_BIT;
stosend = rpf->rpf_addr.u.prefix4;