struct pim_nexthop nexthop;
struct interface *ifp_in;
struct in_addr nh_addr;
- char nexthop_str[INET_ADDRSTRLEN];
nh_addr.s_addr = INADDR_ANY;
zlog_debug("mtrace pim_nexthop_lookup OK");
if (PIM_DEBUG_MTRACE)
- zlog_debug("mtrace next_hop=%s",
- inet_ntop(nexthop.mrib_nexthop_addr.family,
- &nexthop.mrib_nexthop_addr.u.prefix,
- nexthop_str, sizeof(nexthop_str)));
+ zlog_debug("mtrace next_hop=%pI4",
+ &nexthop.mrib_nexthop_addr.u.prefix);
if (nexthop.mrib_nexthop_addr.family == AF_INET)
nh_addr = nexthop.mrib_nexthop_addr.u.prefix4;
struct interface *ifp_in;
struct in_addr nh_addr;
uint32_t total;
- char up_str[INET_ADDRSTRLEN];
memset(&sg, 0, sizeof(struct prefix_sg));
sg.src = mtracep->src_addr;
total = htonl(MTRACE_UNKNOWN_COUNT);
if (PIM_DEBUG_MTRACE)
- zlog_debug("fwd_info: upstream next hop=%s",
- inet_ntop(AF_INET, &(nh_addr), up_str,
- sizeof(up_str)));
+ zlog_debug("fwd_info: upstream next hop=%pI4", &nh_addr);
if (up->channel_oil)
total = up->channel_oil->cc.pktcnt;
static void mtrace_rsp_debug(uint32_t qry_id, int rsp,
struct igmp_mtrace_rsp *mrspp)
{
- char inc_str[INET_ADDRSTRLEN];
- char out_str[INET_ADDRSTRLEN];
- char prv_str[INET_ADDRSTRLEN];
-
zlog_debug(
- "Rx mt(%d) qid=%ud arr=%x in=%s out=%s prev=%s proto=%d fwd=%d",
- rsp, ntohl(qry_id), mrspp->arrival,
- inet_ntop(AF_INET, &(mrspp->incoming), inc_str,
- sizeof(inc_str)),
- inet_ntop(AF_INET, &(mrspp->outgoing), out_str,
- sizeof(out_str)),
- inet_ntop(AF_INET, &(mrspp->prev_hop), prv_str,
- sizeof(prv_str)),
- mrspp->rtg_proto, mrspp->fwd_code);
+ "Rx mt(%d) qid=%ud arr=%x in=%pI4 out=%pI4 prev=%pI4 proto=%d fwd=%d",
+ rsp, ntohl(qry_id), mrspp->arrival, &mrspp->incoming,
+ &mrspp->outgoing, &mrspp->prev_hop, mrspp->rtg_proto,
+ mrspp->fwd_code);
}
static void mtrace_debug(struct pim_interface *pim_ifp,
struct igmp_mtrace *mtracep, int mtrace_len)
{
- char inc_str[INET_ADDRSTRLEN];
- char grp_str[INET_ADDRSTRLEN];
- char src_str[INET_ADDRSTRLEN];
- char dst_str[INET_ADDRSTRLEN];
- char rsp_str[INET_ADDRSTRLEN];
-
struct in_addr ga, sa, da, ra;
ga = mtracep->grp_addr;
ra = mtracep->rsp_addr;
zlog_debug(
- "Rx mtrace packet incoming on %s: hops=%d type=%d size=%d, grp=%s, src=%s, dst=%s rsp=%s ttl=%d qid=%ud",
- inet_ntop(AF_INET, &(pim_ifp->primary_address), inc_str,
- sizeof(inc_str)),
- mtracep->hops, mtracep->type, mtrace_len,
- inet_ntop(AF_INET, &ga, grp_str,
- sizeof(grp_str)),
- inet_ntop(AF_INET, &sa, src_str,
- sizeof(src_str)),
- inet_ntop(AF_INET, &da, dst_str,
- sizeof(dst_str)),
- inet_ntop(AF_INET, &ra, rsp_str,
- sizeof(rsp_str)),
- mtracep->rsp_ttl, ntohl(mtracep->qry_id));
+ "Rx mtrace packet incoming on %pI4: hops=%d type=%d size=%d, grp=%pI4, src=%pI4, dst=%pI4 rsp=%pI4 ttl=%d qid=%ud",
+ &pim_ifp->primary_address, mtracep->hops, mtracep->type,
+ mtrace_len, &ga, &sa, &da, &ra, mtracep->rsp_ttl,
+ ntohl(mtracep->qry_id));
if (mtrace_len > (int)sizeof(struct igmp_mtrace)) {
int i;
ssize_t sent;
int ret;
int fd;
- char if_str[INET_ADDRSTRLEN];
- char rsp_str[INET_ADDRSTRLEN];
uint8_t ttl;
memset(&to, 0, sizeof(to));
struct in_addr if_addr;
if_addr = mtrace_primary_address(ifp);
- zlog_debug(
- "Sending mtrace packet to %s on %s",
- inet_ntop(AF_INET, &mtracep->rsp_addr, rsp_str,
- sizeof(rsp_str)),
- inet_ntop(AF_INET, &if_addr, if_str, sizeof(if_str)));
+ zlog_debug("Sending mtrace packet to %pI4 on %pI4",
+ &mtracep->rsp_addr, &if_addr);
}
fd = pim_socket_raw(IPPROTO_IGMP);
struct listnode *chnextnode;
struct pim_ifchannel *ch = NULL;
int ret = -1;
- char buf[PREFIX_STRLEN];
memset(&sg, 0, sizeof(struct prefix_sg));
sg.grp = mtracep->rsp_addr;
if (c_oil == NULL) {
if (PIM_DEBUG_MTRACE) {
zlog_debug(
- "Dropping mtrace multicast response packet len=%u to %s",
- (unsigned int)mtrace_len,
- inet_ntop(AF_INET, &mtracep->rsp_addr,
- buf, sizeof(buf)));
+ "Dropping mtrace multicast response packet len=%u to %pI4",
+ (unsigned int)mtrace_len, &mtracep->rsp_addr);
}
return -1;
}
if (IPV4_CLASS_DE(ntohl(mtracep->rsp_addr.s_addr))) {
struct pim_rpf *p_rpf;
- char grp_str[INET_ADDRSTRLEN];
if (pim_rp_i_am_rp(pim, mtracep->rsp_addr))
return mtrace_send_mc_response(pim, mtracep,
if (p_rpf == NULL) {
if (PIM_DEBUG_MTRACE)
- zlog_debug("mtrace no RP for %s",
- inet_ntop(AF_INET,
- &(mtracep->rsp_addr),
- grp_str, sizeof(grp_str)));
+ zlog_debug("mtrace no RP for %pI4",
+ &mtracep->rsp_addr);
return -1;
}
nexthop = p_rpf->source_nexthop;