return 0;
}
+#if PIM_IPV == 4
static const char *const igmpmsgtype2str[IGMPMSG_WRVIFWHOLE + 1] = {
"<unknown_upcall?>", "NOCACHE", "WRONGVIF", "WHOLEPKT", "WRVIFWHOLE"};
up->channel_oil->cc.pktcnt++;
// resolve mfcc_parent prior to mroute_add in channel_add_oif
if (up->rpf.source_nexthop.interface &&
- up->channel_oil->oil.mfcc_parent >= MAXVIFS) {
+ *oil_parent(up->channel_oil) >= MAXVIFS) {
pim_upstream_mroute_iif_update(up->channel_oil, __func__);
}
pim_register_join(up);
return 0;
}
+#else /* PIM_IPV != 4 */
+
+static int pim_mroute_msg(struct pim_instance *pim, const char *buf,
+ int buf_size, ifindex_t ifindex)
+{
+ return 0;
+}
+#endif /* PIM_IPV != 4 */
static int mroute_read(struct thread *t)
{
would be used for multicast forwarding, a corresponding multicast
interface must be added to the kernel.
*/
-int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr,
+int pim_mroute_add_vif(struct interface *ifp, pim_addr ifaddr,
unsigned char flags)
{
struct pim_interface *pim_ifp = ifp->info;
err = setsockopt(pim_ifp->pim->mroute_socket, IPPROTO_IP, MRT_ADD_VIF,
(void *)&vc, sizeof(vc));
if (err) {
- char ifaddr_str[INET_ADDRSTRLEN];
-
- pim_inet4_dump("<ifaddr?>", ifaddr, ifaddr_str,
- sizeof(ifaddr_str));
-
zlog_warn(
- "%s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_VIF,vif_index=%d,ifaddr=%s,flag=%d): errno=%d: %s",
+ "%s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_VIF,vif_index=%d,ifaddr=%pPAs,flag=%d): errno=%d: %s",
__func__, pim_ifp->pim->mroute_socket, ifp->ifindex,
- ifaddr_str, flags, errno, safe_strerror(errno));
+ &ifaddr, flags, errno, safe_strerror(errno));
return -2;
}
#endif
}
-static inline void pim_mroute_copy(struct mfcctl *oil,
- struct channel_oil *c_oil)
+static inline void pim_mroute_copy(struct channel_oil *out,
+ struct channel_oil *in)
{
int i;
- oil->mfcc_origin = c_oil->oil.mfcc_origin;
- oil->mfcc_mcastgrp = c_oil->oil.mfcc_mcastgrp;
- oil->mfcc_parent = c_oil->oil.mfcc_parent;
+ *oil_origin(out) = *oil_origin(in);
+ *oil_mcastgrp(out) = *oil_mcastgrp(in);
+ *oil_parent(out) = *oil_parent(in);
for (i = 0; i < MAXVIFS; ++i) {
- if ((oil->mfcc_parent == i) &&
- !pim_mroute_allow_iif_in_oil(c_oil, i)) {
- oil->mfcc_ttls[i] = 0;
+ if (*oil_parent(out) == i &&
+ !pim_mroute_allow_iif_in_oil(in, i)) {
+ oil_if_set(out, i, 0);
continue;
}
- if (c_oil->oif_flags[i] & PIM_OIF_FLAG_MUTE)
- oil->mfcc_ttls[i] = 0;
+ if (in->oif_flags[i] & PIM_OIF_FLAG_MUTE)
+ oil_if_set(out, i, 0);
else
- oil->mfcc_ttls[i] = c_oil->oil.mfcc_ttls[i];
+ oil_if_set(out, i, oil_if_has(in, i));
}
}
static int pim_mroute_add(struct channel_oil *c_oil, const char *name)
{
struct pim_instance *pim = c_oil->pim;
- struct mfcctl tmp_oil = { {0} };
+ struct channel_oil tmp_oil[1] = { };
int err;
pim->mroute_add_last = pim_time_monotonic_sec();
/* Copy the oil to a temporary structure to fixup (without need to
* later restore) before sending the mroute add to the dataplane
*/
- pim_mroute_copy(&tmp_oil, c_oil);
+ pim_mroute_copy(tmp_oil, c_oil);
/* The linux kernel *expects* the incoming
* vif to be part of the outgoing list
* in the case of a (*,G).
*/
- if (c_oil->oil.mfcc_origin.s_addr == INADDR_ANY) {
- tmp_oil.mfcc_ttls[c_oil->oil.mfcc_parent] = 1;
+ if (pim_addr_is_any(*oil_origin(c_oil))) {
+ oil_if_set(tmp_oil, *oil_parent(c_oil), 1);
}
/*
* the packets to be forwarded. Then set it
* to the correct IIF afterwords.
*/
- if (!c_oil->installed && c_oil->oil.mfcc_origin.s_addr != INADDR_ANY
- && c_oil->oil.mfcc_parent != 0) {
- tmp_oil.mfcc_parent = 0;
+ if (!c_oil->installed && !pim_addr_is_any(*oil_origin(c_oil))
+ && *oil_parent(c_oil) != 0) {
+ *oil_parent(tmp_oil) = 0;
}
err = setsockopt(pim->mroute_socket, IPPROTO_IP, MRT_ADD_MFC,
- &tmp_oil, sizeof(tmp_oil));
+ &tmp_oil->oil, sizeof(tmp_oil->oil));
if (!err && !c_oil->installed
- && c_oil->oil.mfcc_origin.s_addr != INADDR_ANY
- && c_oil->oil.mfcc_parent != 0) {
- tmp_oil.mfcc_parent = c_oil->oil.mfcc_parent;
+ && !pim_addr_is_any(*oil_origin(c_oil))
+ && *oil_parent(c_oil) != 0) {
+ *oil_parent(tmp_oil) = *oil_parent(c_oil);
err = setsockopt(pim->mroute_socket, IPPROTO_IP, MRT_ADD_MFC,
- &tmp_oil, sizeof(tmp_oil));
+ &tmp_oil->oil, sizeof(tmp_oil->oil));
}
if (err) {
{
char buf[1000];
- if (c_oil->oil.mfcc_parent >= MAXVIFS) {
+ if (*oil_parent(c_oil) >= MAXVIFS) {
/* the c_oil cannot be installed as a mroute yet */
if (PIM_DEBUG_MROUTE)
zlog_debug(
iif = pim_upstream_get_mroute_iif(c_oil, name);
- if (c_oil->oil.mfcc_parent != iif) {
- c_oil->oil.mfcc_parent = iif;
- if (c_oil->oil.mfcc_origin.s_addr == INADDR_ANY &&
+ if (*oil_parent(c_oil) != iif) {
+ *oil_parent(c_oil) = iif;
+ if (pim_addr_is_any(*oil_origin(c_oil)) &&
c_oil->up)
pim_upstream_all_sources_iif_update(c_oil->up);
} else {
- c_oil->oil.mfcc_parent = iif;
+ *oil_parent(c_oil) = iif;
}
return pim_upstream_mroute_update(c_oil, name);
char buf[1000];
iif = pim_upstream_get_mroute_iif(c_oil, name);
- if (c_oil->oil.mfcc_parent == iif) {
+ if (*oil_parent(c_oil) == iif) {
/* no change */
return 0;
}
- c_oil->oil.mfcc_parent = iif;
+ *oil_parent(c_oil) = iif;
- if (c_oil->oil.mfcc_origin.s_addr == INADDR_ANY &&
+ if (pim_addr_is_any(*oil_origin(c_oil)) &&
c_oil->up)
pim_upstream_all_sources_iif_update(c_oil->up);
int input_vif_index,
const char *name)
{
- if (c_oil->oil.mfcc_parent == input_vif_index)
+ if (*oil_parent(c_oil) == input_vif_index)
return;
- c_oil->oil.mfcc_parent = input_vif_index;
+ *oil_parent(c_oil) = input_vif_index;
if (input_vif_index == MAXVIFS)
pim_mroute_del(c_oil, name);
else
char buf[1000];
zlog_debug(
"%s %s: vifi %d for route is %s not installed, do not need to send del req. ",
- __FILE__, __func__, c_oil->oil.mfcc_parent,
+ __FILE__, __func__, *oil_parent(c_oil),
pim_channel_oil_dump(c_oil, buf, sizeof(buf)));
}
return -2;
void pim_mroute_update_counters(struct channel_oil *c_oil)
{
struct pim_instance *pim = c_oil->pim;
- struct sioc_sg_req sgreq;
c_oil->cc.oldpktcnt = c_oil->cc.pktcnt;
c_oil->cc.oldbytecnt = c_oil->cc.bytecnt;
if (PIM_DEBUG_MROUTE) {
pim_sgaddr sg;
- sg.src = c_oil->oil.mfcc_origin;
- sg.grp = c_oil->oil.mfcc_mcastgrp;
+ sg.src = *oil_origin(c_oil);
+ sg.grp = *oil_mcastgrp(c_oil);
zlog_debug("Channel%pSG is not installed no need to collect data from kernel",
&sg);
}
return;
}
+#if PIM_IPV == 4
+ struct sioc_sg_req sgreq;
+
memset(&sgreq, 0, sizeof(sgreq));
- sgreq.src = c_oil->oil.mfcc_origin;
- sgreq.grp = c_oil->oil.mfcc_mcastgrp;
+ sgreq.src = *oil_origin(c_oil);
+ sgreq.grp = *oil_mcastgrp(c_oil);
pim_zlookup_sg_statistics(c_oil);
if (ioctl(pim->mroute_socket, SIOCGETSGCNT, &sgreq)) {
pim_sgaddr sg;
- sg.src = c_oil->oil.mfcc_origin;
- sg.grp = c_oil->oil.mfcc_mcastgrp;
+ sg.src = *oil_origin(c_oil);
+ sg.grp = *oil_mcastgrp(c_oil);
zlog_warn("ioctl(SIOCGETSGCNT=%lu) failure for (S,G)=%pSG: errno=%d: %s",
(unsigned long)SIOCGETSGCNT, &sg,
c_oil->cc.pktcnt = sgreq.pktcnt;
c_oil->cc.bytecnt = sgreq.bytecnt;
c_oil->cc.wrong_if = sgreq.wrong_if;
-
+#endif
return;
}
pim_sgaddr sg;
int i;
- sg.src = c_oil->oil.mfcc_origin;
- sg.grp = c_oil->oil.mfcc_mcastgrp;
- ifp = pim_if_find_by_vif_index(c_oil->pim, c_oil->oil.mfcc_parent);
+ sg.src = *oil_origin(c_oil);
+ sg.grp = *oil_mcastgrp(c_oil);
+ ifp = pim_if_find_by_vif_index(c_oil->pim, *oil_parent(c_oil));
snprintfrr(buf, size, "%pSG IIF: %s, OIFS: ", &sg,
ifp ? ifp->name : "(?)");
out = buf + strlen(buf);
for (i = 0; i < MAXVIFS; i++) {
- if (c_oil->oil.mfcc_ttls[i] != 0) {
+ if (oil_if_has(c_oil, i) != 0) {
ifp = pim_if_find_by_vif_index(c_oil->pim, i);
snprintf(out, buf + size - out, "%s ",
ifp ? ifp->name : "(?)");
return buf;
}
-int pim_channel_oil_compare(const struct channel_oil *c1,
- const struct channel_oil *c2)
+int pim_channel_oil_compare(const struct channel_oil *cc1,
+ const struct channel_oil *cc2)
{
- if (ntohl(c1->oil.mfcc_mcastgrp.s_addr)
- < ntohl(c2->oil.mfcc_mcastgrp.s_addr))
- return -1;
-
- if (ntohl(c1->oil.mfcc_mcastgrp.s_addr)
- > ntohl(c2->oil.mfcc_mcastgrp.s_addr))
- return 1;
-
- if (ntohl(c1->oil.mfcc_origin.s_addr)
- < ntohl(c2->oil.mfcc_origin.s_addr))
- return -1;
-
- if (ntohl(c1->oil.mfcc_origin.s_addr)
- > ntohl(c2->oil.mfcc_origin.s_addr))
- return 1;
-
+ struct channel_oil *c1 = (struct channel_oil *)cc1;
+ struct channel_oil *c2 = (struct channel_oil *)cc2;
+ int rv;
+
+ rv = pim_addr_cmp(*oil_mcastgrp(c1), *oil_mcastgrp(c2));
+ if (rv)
+ return rv;
+ rv = pim_addr_cmp(*oil_origin(c1), *oil_origin(c2));
+ if (rv)
+ return rv;
return 0;
}
struct channel_oil *c_oil = NULL;
struct channel_oil lookup;
- lookup.oil.mfcc_mcastgrp = sg->grp;
- lookup.oil.mfcc_origin = sg->src;
+ *oil_mcastgrp(&lookup) = sg->grp;
+ *oil_origin(&lookup) = sg->src;
c_oil = rb_pim_oil_find(&pim->channel_oil_head, &lookup);
c_oil = XCALLOC(MTYPE_PIM_CHANNEL_OIL, sizeof(*c_oil));
- c_oil->oil.mfcc_mcastgrp = sg->grp;
- c_oil->oil.mfcc_origin = sg->src;
+ *oil_mcastgrp(c_oil) = sg->grp;
+ *oil_origin(c_oil) = sg->src;
- c_oil->oil.mfcc_parent = MAXVIFS;
+ *oil_parent(c_oil) = MAXVIFS;
c_oil->oil_ref_count = 1;
c_oil->installed = 0;
c_oil->up = pim_upstream_find(pim, sg);
const char *name)
{
if (PIM_DEBUG_MROUTE) {
- pim_sgaddr sg = {.src = c_oil->oil.mfcc_mcastgrp,
- .grp = c_oil->oil.mfcc_origin};
+ pim_sgaddr sg = {.src = *oil_mcastgrp(c_oil),
+ .grp = *oil_origin(c_oil)};
zlog_debug(
"%s(%s): Del oil for %pSG, Ref Count: %d (Predecrement)",
*/
if (!(channel_oil->oif_flags[pim_ifp->mroute_vif_index] & proto_mask)) {
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
zlog_debug(
- "%s %s: no existing protocol mask %u(%u) for requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)",
+ "%s %s: no existing protocol mask %u(%u) for requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%pPAs,%pPAs)",
__FILE__, __func__, proto_mask,
channel_oil
->oif_flags[pim_ifp->mroute_vif_index],
oif->name, pim_ifp->mroute_vif_index,
- channel_oil->oil
- .mfcc_ttls[pim_ifp->mroute_vif_index],
- source_str, group_str);
+ oil_if_has(channel_oil, pim_ifp->mroute_vif_index),
+ oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil));
}
return 0;
}
if (channel_oil->oif_flags[pim_ifp->mroute_vif_index] &
PIM_OIF_FLAG_PROTO_ANY) {
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
zlog_debug(
- "%s %s: other protocol masks remain for requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)",
+ "%s %s: other protocol masks remain for requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%pPAs,%pPAs)",
__FILE__, __func__, oif->name,
pim_ifp->mroute_vif_index,
- channel_oil->oil
- .mfcc_ttls[pim_ifp->mroute_vif_index],
- source_str, group_str);
+ oil_if_has(channel_oil, pim_ifp->mroute_vif_index),
+ oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil));
}
return 0;
}
- channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] = 0;
+ oil_if_set(channel_oil, pim_ifp->mroute_vif_index, false);
/* clear mute; will be re-evaluated when the OIF becomes valid again */
channel_oil->oif_flags[pim_ifp->mroute_vif_index] &= ~PIM_OIF_FLAG_MUTE;
if (pim_upstream_mroute_add(channel_oil, __func__)) {
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
zlog_debug(
- "%s %s: could not remove output interface %s (vif_index=%d) for channel (S,G)=(%s,%s)",
+ "%s %s: could not remove output interface %s (vif_index=%d) for channel (S,G)=(%pPAs,%pPAs)",
__FILE__, __func__, oif->name,
- pim_ifp->mroute_vif_index, source_str,
- group_str);
+ pim_ifp->mroute_vif_index,
+ oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil));
}
return -1;
}
--channel_oil->oil_size;
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>", channel_oil->oil.mfcc_origin,
- source_str, sizeof(source_str));
zlog_debug(
- "%s(%s): (S,G)=(%s,%s): proto_mask=%u IIF:%d OIF=%s vif_index=%d",
- __func__, caller, source_str, group_str, proto_mask,
- channel_oil->oil.mfcc_parent, oif->name,
+ "%s(%s): (S,G)=(%pPAs,%pPAs): proto_mask=%u IIF:%d OIF=%s vif_index=%d",
+ __func__, caller, oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil),
+ proto_mask,
+ *oil_parent(channel_oil), oif->name,
pim_ifp->mroute_vif_index);
}
bool new_mute;
/* If pim_ifp is not a part of the OIL there is nothing to do */
- if (!c_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index])
+ if (!oil_if_has(c_oil, pim_ifp->mroute_vif_index))
return;
old_mute = !!(c_oil->oif_flags[pim_ifp->mroute_vif_index] &
channel (S,G) multiple times */
if (channel_oil->oif_flags[pim_ifp->mroute_vif_index] & proto_mask) {
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
zlog_debug(
- "%s %s: existing protocol mask %u requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)",
+ "%s %s: existing protocol mask %u requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%pPAs,%pPAs)",
__FILE__, __func__, proto_mask, oif->name,
pim_ifp->mroute_vif_index,
- channel_oil->oil
- .mfcc_ttls[pim_ifp->mroute_vif_index],
- source_str, group_str);
+ oil_if_has(channel_oil, pim_ifp->mroute_vif_index),
+ oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil));
}
return -3;
}
channel_oil->oif_flags[pim_ifp->mroute_vif_index] |= proto_mask;
/* Check the OIF really exists before returning, and only log
warning otherwise */
- if (channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] < 1) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
+ if (oil_if_has(channel_oil, pim_ifp->mroute_vif_index) < 1) {
zlog_warn(
- "%s %s: new protocol mask %u requested nonexistent OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)",
+ "%s %s: new protocol mask %u requested nonexistent OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%pPAs,%pPAs)",
__FILE__, __func__, proto_mask, oif->name,
pim_ifp->mroute_vif_index,
- channel_oil->oil
- .mfcc_ttls[pim_ifp->mroute_vif_index],
- source_str, group_str);
+ oil_if_has(channel_oil, pim_ifp->mroute_vif_index),
+ oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil));
}
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
zlog_debug(
- "%s(%s): (S,G)=(%s,%s): proto_mask=%u OIF=%s vif_index=%d added to 0x%x",
- __func__, caller, source_str, group_str,
+ "%s(%s): (S,G)=(%pPAs,%pPAs): proto_mask=%u OIF=%s vif_index=%d added to 0x%x",
+ __func__, caller, oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil),
proto_mask, oif->name,
pim_ifp->mroute_vif_index,
channel_oil
return 0;
}
- old_ttl = channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index];
+ old_ttl = oil_if_has(channel_oil, pim_ifp->mroute_vif_index);
if (old_ttl > 0) {
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
zlog_debug(
- "%s %s: interface %s (vif_index=%d) is existing output for channel (S,G)=(%s,%s)",
+ "%s %s: interface %s (vif_index=%d) is existing output for channel (S,G)=(%pPAs,%pPAs)",
__FILE__, __func__, oif->name,
- pim_ifp->mroute_vif_index, source_str,
- group_str);
+ pim_ifp->mroute_vif_index,
+ oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil));
}
return -4;
}
- channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] =
- PIM_MROUTE_MIN_TTL;
+ oil_if_set(channel_oil, pim_ifp->mroute_vif_index, PIM_MROUTE_MIN_TTL);
/* Some OIFs are held in a muted state i.e. the PIM state machine
* decided to include the OIF but additional status check such as
/* channel_oil->oil.mfcc_parent != MAXVIFS indicate this entry is not
* valid to get installed in kernel.
*/
- if (channel_oil->oil.mfcc_parent != MAXVIFS) {
+ if (*oil_parent(channel_oil) != MAXVIFS) {
if (pim_upstream_mroute_add(channel_oil, __func__)) {
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>",
- channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>",
- channel_oil->oil.mfcc_origin, source_str,
- sizeof(source_str));
zlog_debug(
- "%s %s: could not add output interface %s (vif_index=%d) for channel (S,G)=(%s,%s)",
+ "%s %s: could not add output interface %s (vif_index=%d) for channel (S,G)=(%pPAs,%pPAs)",
__FILE__, __func__, oif->name,
- pim_ifp->mroute_vif_index, source_str,
- group_str);
+ pim_ifp->mroute_vif_index,
+ oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil));
}
- channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index]
- = old_ttl;
+ oil_if_set(channel_oil, pim_ifp->mroute_vif_index,
+ old_ttl);
return -5;
}
}
channel_oil->oif_flags[pim_ifp->mroute_vif_index] |= proto_mask;
if (PIM_DEBUG_MROUTE) {
- char group_str[INET_ADDRSTRLEN];
- char source_str[INET_ADDRSTRLEN];
- pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp,
- group_str, sizeof(group_str));
- pim_inet4_dump("<source?>", channel_oil->oil.mfcc_origin,
- source_str, sizeof(source_str));
zlog_debug(
- "%s(%s): (S,G)=(%s,%s): proto_mask=%u OIF=%s vif_index=%d: DONE",
- __func__, caller, source_str, group_str, proto_mask,
+ "%s(%s): (S,G)=(%pPAs,%pPAs): proto_mask=%u OIF=%s vif_index=%d: DONE",
+ __func__, caller, oil_origin(channel_oil),
+ oil_mcastgrp(channel_oil),
+ proto_mask,
oif->name, pim_ifp->mroute_vif_index);
}
int pim_channel_oil_empty(struct channel_oil *c_oil)
{
- static struct mfcctl null_oil;
-
if (!c_oil)
return 1;
* non-NULL.
* pimreg device (in all vrfs) uses a vifi of
* 0 (PIM_OIF_PIM_REGISTER_VIF) so we simply mfcc_ttls[0] */
+#if PIM_IPV == 4
+ static pim_mfcctl null_oil;
+
return !memcmp(&c_oil->oil.mfcc_ttls[1], &null_oil.mfcc_ttls[1],
sizeof(null_oil.mfcc_ttls) - sizeof(null_oil.mfcc_ttls[0]));
+#else
+ CPP_NOTICE("FIXME STUB");
+ return false;
+#endif
}