]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: remove usage of inet_ntop
authorDonald Sharp <sharpd@nvidia.com>
Fri, 5 Nov 2021 22:05:21 +0000 (18:05 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 5 Nov 2021 22:05:21 +0000 (18:05 -0400)
We should not be using inet_ntop. and should be using
the appropriate %pI4 instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pimd/pim_join.c
pimd/pim_register.c

index 652b27476df70099771252ff41d6b9c19bb7c6ac..4606aec6a162805002019e0b2015c618792f8321 100644 (file)
@@ -1,3 +1,5 @@
+
+
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
@@ -56,7 +58,6 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
                      struct prefix_sg *sg, uint8_t source_flags)
 {
        struct pim_interface *pim_ifp = NULL;
-       char buf[PREFIX_STRLEN];
 
        if (PIM_DEBUG_PIM_TRACE) {
                char up_str[INET_ADDRSTRLEN];
@@ -109,9 +110,8 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
 
                if (pim_is_grp_ssm(pim_ifp->pim, sg->grp)) {
                        zlog_warn(
-                               "%s: Specified Group(%s) in join is now in SSM, not allowed to create PIM state",
-                               __func__,
-                               inet_ntop(AF_INET, &sg->grp, buf, sizeof(buf)));
+                               "%s: Specified Group(%pI4) in join is now in SSM, not allowed to create PIM state",
+                               __func__, &sg->grp);
                        return;
                }
 
index fc464753e0b09b4be88d49f20a4bce26af353369..e2538da36f35face5d0d3101369b420da86b1f12 100644 (file)
@@ -323,7 +323,6 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
        int i_am_rp = 0;
        struct pim_interface *pim_ifp = ifp->info;
        struct pim_instance *pim = pim_ifp->pim;
-       char buf[PREFIX_STRLEN];
 
 #define PIM_MSG_REGISTER_BIT_RESERVED_LEN 4
        ip_hdr = (struct ip *)(tlv_buf + PIM_MSG_REGISTER_BIT_RESERVED_LEN);
@@ -385,9 +384,8 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
        if (pim_is_grp_ssm(pim_ifp->pim, sg.grp)) {
                if (sg.src.s_addr == INADDR_ANY) {
                        zlog_warn(
-                               "%s: Received Register message for Group(%s) is now in SSM, dropping the packet",
-                               __func__,
-                               inet_ntop(AF_INET, &sg.grp, buf, sizeof(buf)));
+                               "%s: Received Register message for Group(%pI4) is now in SSM, dropping the packet",
+                               __func__, &sg.grp);
                        /* Drop Packet Silently */
                        return 0;
                }