]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_mroute.c
Merge pull request #10746 from ton31337/feature/show_group_type_under_rp_info_cli
[mirror_frr.git] / pimd / pim_mroute.c
index 7743bcc51048dcb6ac2f3b28603ffc4d3abde990..f381a764ccc54faaa529b2538bf8022a740ca80e 100644 (file)
@@ -145,6 +145,7 @@ static int pim_mroute_set(struct pim_instance *pim, int enable)
        return 0;
 }
 
+#if PIM_IPV == 4
 static const char *const igmpmsgtype2str[IGMPMSG_WRVIFWHOLE + 1] = {
        "<unknown_upcall?>", "NOCACHE", "WRONGVIF", "WHOLEPKT", "WRVIFWHOLE"};
 
@@ -154,7 +155,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
        struct pim_interface *pim_ifp = ifp->info;
        struct pim_upstream *up;
        struct pim_rpf *rpg;
-       struct prefix_sg sg;
+       pim_sgaddr sg;
 
        rpg = pim_ifp ? RP(pim_ifp->pim, msg->im_dst) : NULL;
        /*
@@ -162,7 +163,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
         * the Interface type is SSM we don't need to
         * do anything here
         */
-       if (!rpg || pim_rpf_addr_is_inaddr_none(rpg)) {
+       if (!rpg || pim_rpf_addr_is_inaddr_any(rpg)) {
                if (PIM_DEBUG_MROUTE_DETAIL)
                        zlog_debug(
                                "%s: Interface is not configured correctly to handle incoming packet: Could be !pim_ifp, !SM, !RP",
@@ -183,15 +184,14 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
                return 0;
        }
 
-       memset(&sg, 0, sizeof(struct prefix_sg));
+       memset(&sg, 0, sizeof(sg));
        sg.src = msg->im_src;
        sg.grp = msg->im_dst;
 
        if (!(PIM_I_am_DR(pim_ifp))) {
                if (PIM_DEBUG_MROUTE_DETAIL)
-                       zlog_debug(
-                               "%s: Interface is not the DR blackholing incoming traffic for %s",
-                               __func__, pim_str_sg_dump(&sg));
+                       zlog_debug("%s: Interface is not the DR blackholing incoming traffic for %pSG",
+                                  __func__, &sg);
 
                /*
                 * We are not the DR, but we are still receiving packets
@@ -228,7 +228,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
        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);
@@ -242,7 +242,7 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
                                   const char *buf)
 {
        struct pim_interface *pim_ifp;
-       struct prefix_sg sg;
+       pim_sgaddr sg;
        struct pim_rpf *rpg;
        const struct ip *ip_hdr;
        struct pim_upstream *up;
@@ -251,14 +251,14 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
 
        ip_hdr = (const struct ip *)buf;
 
-       memset(&sg, 0, sizeof(struct prefix_sg));
+       memset(&sg, 0, sizeof(sg));
        sg.src = ip_hdr->ip_src;
        sg.grp = ip_hdr->ip_dst;
 
        up = pim_upstream_find(pim_ifp->pim, &sg);
        if (!up) {
-               struct prefix_sg star = sg;
-               star.src.s_addr = INADDR_ANY;
+               pim_sgaddr star = sg;
+               star.src = PIMADDR_ANY;
 
                up = pim_upstream_find(pim_ifp->pim, &star);
 
@@ -268,9 +268,8 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
                                              __func__, NULL);
                        if (!up) {
                                if (PIM_DEBUG_MROUTE)
-                                       zlog_debug(
-                                               "%s: Unable to create upstream information for %s",
-                                               __func__, pim_str_sg_dump(&sg));
+                                       zlog_debug("%s: Unable to create upstream information for %pSG",
+                                                  __func__, &sg);
                                return 0;
                        }
                        pim_upstream_keep_alive_timer_start(
@@ -284,9 +283,8 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
                        return 0;
                }
                if (PIM_DEBUG_MROUTE_DETAIL) {
-                       zlog_debug(
-                               "%s: Unable to find upstream channel WHOLEPKT%s",
-                               __func__, pim_str_sg_dump(&sg));
+                       zlog_debug("%s: Unable to find upstream channel WHOLEPKT%pSG",
+                                  __func__, &sg);
                }
                return 0;
        }
@@ -302,8 +300,8 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
 
        rpg = pim_ifp ? RP(pim_ifp->pim, sg.grp) : NULL;
 
-       if ((pim_rpf_addr_is_inaddr_none(rpg)) || (!pim_ifp)
-           || (!(PIM_I_am_DR(pim_ifp)))) {
+       if ((pim_rpf_addr_is_inaddr_any(rpg)) || (!pim_ifp) ||
+           (!(PIM_I_am_DR(pim_ifp)))) {
                if (PIM_DEBUG_MROUTE) {
                        zlog_debug("%s: Failed Check send packet", __func__);
                }
@@ -316,9 +314,8 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,
        if (!up->t_rs_timer) {
                if (pim_is_grp_ssm(pim_ifp->pim, sg.grp)) {
                        if (PIM_DEBUG_PIM_REG)
-                               zlog_debug(
-                                       "%s register forward skipped as group is SSM",
-                                       pim_str_sg_dump(&sg));
+                               zlog_debug("%pSG register forward skipped as group is SSM",
+                                          &sg);
                        return 0;
                }
 
@@ -342,9 +339,9 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,
 {
        struct pim_ifchannel *ch;
        struct pim_interface *pim_ifp;
-       struct prefix_sg sg;
+       pim_sgaddr sg;
 
-       memset(&sg, 0, sizeof(struct prefix_sg));
+       memset(&sg, 0, sizeof(sg));
        sg.src = msg->im_src;
        sg.grp = msg->im_dst;
 
@@ -361,37 +358,33 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,
 
        if (!ifp) {
                if (PIM_DEBUG_MROUTE)
-                       zlog_debug(
-                               "%s: WRONGVIF (S,G)=%s could not find input interface for input_vif_index=%d",
-                               __func__, pim_str_sg_dump(&sg), msg->im_vif);
+                       zlog_debug("%s: WRONGVIF (S,G)=%pSG could not find input interface for input_vif_index=%d",
+                                  __func__, &sg, msg->im_vif);
                return -1;
        }
 
        pim_ifp = ifp->info;
        if (!pim_ifp) {
                if (PIM_DEBUG_MROUTE)
-                       zlog_debug(
-                               "%s: WRONGVIF (S,G)=%s multicast not enabled on interface %s",
-                               __func__, pim_str_sg_dump(&sg), ifp->name);
+                       zlog_debug("%s: WRONGVIF (S,G)=%pSG multicast not enabled on interface %s",
+                                  __func__, &sg, ifp->name);
                return -2;
        }
 
        ch = pim_ifchannel_find(ifp, &sg);
        if (!ch) {
-               struct prefix_sg star_g = sg;
+               pim_sgaddr star_g = sg;
                if (PIM_DEBUG_MROUTE)
-                       zlog_debug(
-                               "%s: WRONGVIF (S,G)=%s could not find channel on interface %s",
-                               __func__, pim_str_sg_dump(&sg), ifp->name);
+                       zlog_debug("%s: WRONGVIF (S,G)=%pSG could not find channel on interface %s",
+                                  __func__, &sg, ifp->name);
 
-               star_g.src.s_addr = INADDR_ANY;
+               star_g.src = PIMADDR_ANY;
                ch = pim_ifchannel_find(ifp, &star_g);
                if (!ch) {
                        if (PIM_DEBUG_MROUTE)
-                               zlog_debug(
-                                       "%s: WRONGVIF (*,G)=%s could not find channel on interface %s",
-                                       __func__, pim_str_sg_dump(&star_g),
-                                       ifp->name);
+                               zlog_debug("%s: WRONGVIF (*,G)=%pSG could not find channel on interface %s",
+                                          __func__, &star_g,
+                                          ifp->name);
                        return -3;
                }
        }
@@ -448,12 +441,12 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,
        struct pim_instance *pim;
        struct pim_ifchannel *ch;
        struct pim_upstream *up;
-       struct prefix_sg star_g;
-       struct prefix_sg sg;
+       pim_sgaddr star_g;
+       pim_sgaddr sg;
 
        pim_ifp = ifp->info;
 
-       memset(&sg, 0, sizeof(struct prefix_sg));
+       memset(&sg, 0, sizeof(sg));
        sg.src = ip_hdr->ip_src;
        sg.grp = ip_hdr->ip_dst;
 
@@ -467,7 +460,7 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,
        }
 
        star_g = sg;
-       star_g.src.s_addr = INADDR_ANY;
+       star_g.src = PIMADDR_ANY;
 
        pim = pim_ifp->pim;
        /*
@@ -558,9 +551,8 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,
                                      NULL);
                if (!up) {
                        if (PIM_DEBUG_MROUTE)
-                               zlog_debug(
-                                       "%s: WRONGVIF%s unable to create upstream on interface",
-                                       pim_str_sg_dump(&sg), ifp->name);
+                               zlog_debug("%pSG: WRONGVIF%s unable to create upstream on interface",
+                                          &sg, ifp->name);
                        return -2;
                }
                PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
@@ -589,12 +581,8 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,
                          int buf_size, ifindex_t ifindex)
 {
        struct interface *ifp;
-       struct pim_interface *pim_ifp;
        const struct ip *ip_hdr;
        const struct igmpmsg *msg;
-       struct in_addr ifaddr;
-       struct igmp_sock *igmp;
-       const struct prefix *connected_src;
 
        if (buf_size < (int)sizeof(struct ip))
                return 0;
@@ -602,6 +590,11 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,
        ip_hdr = (const struct ip *)buf;
 
        if (ip_hdr->ip_p == IPPROTO_IGMP) {
+#if PIM_IPV == 4
+               struct pim_interface *pim_ifp;
+               struct in_addr ifaddr;
+               struct gm_sock *igmp;
+               const struct prefix *connected_src;
 
                /* We have the IP packet but we do not know which interface this
                 * packet was
@@ -626,7 +619,8 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,
 
                pim_ifp = ifp->info;
                ifaddr = connected_src->u.prefix4;
-               igmp = pim_igmp_sock_lookup_ifaddr(pim_ifp->igmp_socket_list, ifaddr);
+               igmp = pim_igmp_sock_lookup_ifaddr(pim_ifp->gm_socket_list,
+                                                  ifaddr);
 
                if (PIM_DEBUG_IGMP_PACKETS) {
                        zlog_debug(
@@ -640,6 +634,7 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,
                        zlog_debug("No IGMP socket on interface: %s with connected source: %pFX",
                                   ifp->name, connected_src);
                }
+#endif
        } else if (ip_hdr->ip_p) {
                if (PIM_DEBUG_MROUTE_DETAIL) {
                        zlog_debug(
@@ -684,13 +679,20 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,
 
        return 0;
 }
+#else /* PIM_IPV != 4 */
 
-static int mroute_read(struct thread *t)
+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 void mroute_read(struct thread *t)
 {
        struct pim_instance *pim;
        static long long count;
        char buf[10000];
-       int result = 0;
        int cont = 1;
        int rd;
        ifindex_t ifindex;
@@ -713,7 +715,7 @@ static int mroute_read(struct thread *t)
                        goto done;
                }
 
-               result = pim_mroute_msg(pim, buf, rd, ifindex);
+               pim_mroute_msg(pim, buf, rd, ifindex);
 
                count++;
                if (count % router->packet_process == 0)
@@ -722,8 +724,6 @@ static int mroute_read(struct thread *t)
 /* Keep reading */
 done:
        mroute_read_on(pim);
-
-       return result;
 }
 
 static void mroute_read_on(struct pim_instance *pim)
@@ -808,7 +808,7 @@ int pim_mroute_socket_disable(struct pim_instance *pim)
   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;
@@ -847,15 +847,10 @@ int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr,
        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;
        }
 
@@ -929,26 +924,26 @@ bool pim_mroute_allow_iif_in_oil(struct channel_oil *c_oil,
 #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));
        }
 }
 
@@ -958,7 +953,7 @@ static inline void pim_mroute_copy(struct mfcctl *oil,
 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();
@@ -967,14 +962,14 @@ static int pim_mroute_add(struct channel_oil *c_oil, const char *name)
        /* 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);
        }
 
        /*
@@ -984,19 +979,19 @@ static int pim_mroute_add(struct channel_oil *c_oil, const char *name)
         * 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) {
@@ -1051,7 +1046,7 @@ static int pim_upstream_mroute_update(struct channel_oil *c_oil,
 {
        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(
@@ -1098,13 +1093,13 @@ int pim_upstream_mroute_add(struct channel_oil *c_oil, const char *name)
 
        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);
@@ -1119,13 +1114,13 @@ int pim_upstream_mroute_iif_update(struct channel_oil *c_oil, const char *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);
 
@@ -1148,10 +1143,10 @@ void pim_static_mroute_iif_update(struct channel_oil *c_oil,
                                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
@@ -1171,7 +1166,7 @@ int pim_mroute_del(struct channel_oil *c_oil, const char *name)
                        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;
@@ -1204,7 +1199,6 @@ int pim_mroute_del(struct channel_oil *c_oil, const char *name)
 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;
@@ -1213,30 +1207,32 @@ void pim_mroute_update_counters(struct channel_oil *c_oil)
        if (!c_oil->installed) {
                c_oil->cc.lastused = 100 * pim->keep_alive_time;
                if (PIM_DEBUG_MROUTE) {
-                       struct prefix_sg sg;
+                       pim_sgaddr sg;
 
-                       sg.src = c_oil->oil.mfcc_origin;
-                       sg.grp = c_oil->oil.mfcc_mcastgrp;
-                       zlog_debug(
-                               "Channel%s is not installed no need to collect data from kernel",
-                               pim_str_sg_dump(&sg));
+                       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)) {
-               struct prefix_sg sg;
+               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)=%s: errno=%d: %s",
-                         (unsigned long)SIOCGETSGCNT, pim_str_sg_dump(&sg),
+               zlog_warn("ioctl(SIOCGETSGCNT=%lu) failure for (S,G)=%pSG: errno=%d: %s",
+                         (unsigned long)SIOCGETSGCNT, &sg,
                          errno, safe_strerror(errno));
                return;
        }
@@ -1244,6 +1240,6 @@ void pim_mroute_update_counters(struct channel_oil *c_oil)
        c_oil->cc.pktcnt = sgreq.pktcnt;
        c_oil->cc.bytecnt = sgreq.bytecnt;
        c_oil->cc.wrong_if = sgreq.wrong_if;
-
+#endif
        return;
 }