]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: remove line breaks from log messages
authorDavid Lamparter <equinox@diac24.net>
Tue, 24 Mar 2020 18:15:04 +0000 (19:15 +0100)
committerDavid Lamparter <equinox@diac24.net>
Tue, 24 Mar 2020 18:43:18 +0000 (19:43 +0100)
Line break at the end of the message is implicit for zlog_* and flog_*,
don't put it in the string.  Mid-message line breaks are currently
unsupported.  (LF is "end of message" in syslog.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_bmp.c
bgpd/bgp_route.c
isisd/isis_adjacency.c
ospfd/ospf_ase.c
ospfd/ospf_lsa.c
ospfd/ospf_packet.c
ospfd/ospf_ri.c
pimd/pim_bsm.c
pimd/pim_register.c
zebra/kernel_socket.c
zebra/zapi_msg.c

index 32865da376a77625245e779905996fe74e559178..65a032abd5b992bf82ab2e779ac278669a7cc12c 100644 (file)
@@ -385,15 +385,15 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down)
                        stream_put(s, bbpeer->open_tx, bbpeer->open_tx_len);
                else {
                        stream_put(s, dummy_open, sizeof(dummy_open));
-                       zlog_warn("bmp: missing TX OPEN message for peer %s\n",
-                                       peer->host);
+                       zlog_warn("bmp: missing TX OPEN message for peer %s",
+                                 peer->host);
                }
                if (bbpeer && bbpeer->open_rx)
                        stream_put(s, bbpeer->open_rx, bbpeer->open_rx_len);
                else {
                        stream_put(s, dummy_open, sizeof(dummy_open));
-                       zlog_warn("bmp: missing RX OPEN message for peer %s\n",
-                                       peer->host);
+                       zlog_warn("bmp: missing RX OPEN message for peer %s",
+                                 peer->host);
                }
 
                if (peer->desc)
@@ -1342,8 +1342,7 @@ static int bmp_accept(struct thread *thread)
        /* We can handle IPv4 or IPv6 socket. */
        bmp_sock = sockunion_accept(bl->sock, &su);
        if (bmp_sock < 0) {
-               zlog_info("bmp: accept_sock failed: %s\n",
-                          safe_strerror (errno));
+               zlog_info("bmp: accept_sock failed: %s", safe_strerror(errno));
                return -1;
        }
        bmp_open(bl->targets, bmp_sock);
index 1bd5780a209ceea7ed0ebadd683aecb101a17edb..a56549a1132f9c696c3203b3a3aeb1d370bc63a5 100644 (file)
@@ -6845,7 +6845,7 @@ static int bgp_aggregate_set(struct vty *vty, const char *prefix_str, afi_t afi,
                if (as_set == AGGREGATE_AS_SET) {
                        as_set_new = AGGREGATE_AS_UNSET;
                        zlog_warn(
-                               "%s: Ignoring as-set because `bgp reject-as-sets` is enabled.\n",
+                               "%s: Ignoring as-set because `bgp reject-as-sets` is enabled.",
                                __func__);
                        vty_out(vty,
                                "Ignoring as-set because `bgp reject-as-sets` is enabled.\n");
index 1d70521e6812da2bb91157c5d59a51179a9fb542..9beed206e8050c03c33551bf9898c1b77facfe53 100644 (file)
@@ -353,7 +353,7 @@ void isis_adj_print(struct isis_adjacency *adj)
        if (dyn)
                zlog_debug("%s", dyn->hostname);
 
-       zlog_debug("SystemId %20s SNPA %s, level %d\nHolding Time %d",
+       zlog_debug("SystemId %20s SNPA %s, level %dHolding Time %d",
                   sysid_print(adj->sysid), snpa_print(adj->snpa), adj->level,
                   adj->hold_time);
        if (adj->ipv4_address_count) {
index 2c80d485a3fe6f44881907b8822e497ea36f86b8..30940cf010b2df43bb74e82d3bdd080bc1df4fb5 100644 (file)
@@ -691,7 +691,7 @@ static int ospf_ase_calculate_timer(struct thread *t)
 
                if (IS_DEBUG_OSPF_EVENT)
                        zlog_info(
-                               "SPF Processing Time(usecs): External Routes: %lld\n",
+                               "SPF Processing Time(usecs): External Routes: %lld",
                                (stop_time.tv_sec - start_time.tv_sec)
                                                * 1000000LL
                                        + (stop_time.tv_usec
index 55ec638522a577230b2a72cc7a25cad837530809..d50f390e3013ec2074dad61b2fa61db535106568 100644 (file)
@@ -2805,7 +2805,7 @@ static int ospf_maxage_lsa_remover(struct thread *thread)
                        if (CHECK_FLAG(lsa->flags, OSPF_LSA_PREMATURE_AGE)) {
                                if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
                                        zlog_debug(
-                                               "originating new lsa for lsa 0x%p\n",
+                                               "originating new lsa for lsa 0x%p",
                                                (void *)lsa);
                                ospf_lsa_refresh(ospf, lsa);
                        }
index 0808f245e2bded8ed7b1b437a14974a245567538..aa50aeacbc634382e6463f35679b4e6c838ca622 100644 (file)
@@ -611,7 +611,7 @@ static void ospf_write_frags(int fd, struct ospf_packet *op, struct ip *iph,
 
                if (IS_DEBUG_OSPF_PACKET(type - 1, SEND)) {
                        zlog_debug(
-                               "ospf_write_frags: sent id %d, off %d, len %d to %s\n",
+                               "ospf_write_frags: sent id %d, off %d, len %d to %s",
                                iph->ip_id, iph->ip_off, iph->ip_len,
                                inet_ntoa(iph->ip_dst));
                }
index 5f01edfbdfa75889d454c91d767b62e7a812133a..fbe513cea0ab3737fb7eec7a30081d5de81575bb 100644 (file)
@@ -1382,9 +1382,8 @@ static uint16_t show_vty_sr_algorithm(struct vty *vty, struct tlv_header *tlvh)
                                zlog_debug("    Algorithm %d: Strict SPF", i);
                                break;
                        default:
-                               zlog_debug(
-                                       "    Algorithm %d: Unknown value %d\n",
-                                       i, algo->value[i]);
+                               zlog_debug("    Algorithm %d: Unknown value %d",
+                                          i, algo->value[i]);
                                break;
                        }
        }
index f55934909a000d0f75370e6f9c55af6fb67ce25c..ad47427101bbb1c46a1b812896d2edbe077c8a96 100644 (file)
@@ -1068,13 +1068,13 @@ static bool pim_install_bsm_grp_rp(struct pim_instance *pim,
        if (listnode_add_sort_nodup(grpnode->partial_bsrp_list, bsm_rpinfo)) {
                if (PIM_DEBUG_BSM)
                        zlog_debug(
-                               "%s, bs_rpinfo node added to the partial bs_rplist.\r\n",
+                               "%s, bs_rpinfo node added to the partial bs_rplist.",
                                __func__);
                return true;
        }
 
        if (PIM_DEBUG_BSM)
-               zlog_debug("%s: list node not added\n", __func__);
+               zlog_debug("%s: list node not added", __func__);
 
        XFREE(MTYPE_PIM_BSRP_NODE, bsm_rpinfo);
        return false;
@@ -1092,7 +1092,7 @@ static void pim_update_pending_rp_cnt(struct bsm_scope *sz,
                if (bsm_frag_tag != bsgrp->frag_tag) {
                        if (PIM_DEBUG_BSM)
                                zlog_debug(
-                                       "%s,Received a new BSM ,so clear the pending bs_rpinfo list.\r\n",
+                                       "%s,Received a new BSM ,so clear the pending bs_rpinfo list.",
                                        __func__);
                        list_delete_all_node(bsgrp->partial_bsrp_list);
                        bsgrp->pend_rp_cnt = total_rp_count;
@@ -1132,7 +1132,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,
                        pim_inet4_dump("<Group?>", grpinfo.group.addr, grp_str,
                                       sizeof(grp_str));
                        zlog_debug(
-                               "%s, Group %s  Rpcount:%d Fragment-Rp-count:%d\r\n",
+                               "%s, Group %s  Rpcount:%d Fragment-Rp-count:%d",
                                __func__, grp_str, grpinfo.rp_count,
                                grpinfo.frag_rp_count);
                }
@@ -1146,9 +1146,8 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,
 
                                pim_inet4_dump("<Group?>", grpinfo.group.addr,
                                               grp_str, sizeof(grp_str));
-                               zlog_debug(
-                                       "%s, Rp count is zero for group: %s\r\n",
-                                       __func__, grp_str);
+                               zlog_debug("%s, Rp count is zero for group: %s",
+                                          __func__, grp_str);
                        }
                        return false;
                }
@@ -1169,9 +1168,8 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,
 
                if (!bsgrp) {
                        if (PIM_DEBUG_BSM)
-                               zlog_debug(
-                                       "%s, Create new  BSM Group node.\r\n",
-                                       __func__);
+                               zlog_debug("%s, Create new  BSM Group node.",
+                                          __func__);
 
                        /* create a new node to be added to the tree. */
                        bsgrp = pim_bsm_new_bsgrp_node(scope->bsrp_table,
@@ -1179,7 +1177,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,
 
                        if (!bsgrp) {
                                zlog_debug(
-                                       "%s, Failed to get the BSM group node.\r\n",
+                                       "%s, Failed to get the BSM group node.",
                                        __func__);
                                continue;
                        }
@@ -1214,7 +1212,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,
                                pim_inet4_dump("<Rpaddr?>", rpinfo.rpaddr.addr,
                                               rp_str, sizeof(rp_str));
                                zlog_debug(
-                                       "%s, Rp address - %s; pri:%d hold:%d\r\n",
+                                       "%s, Rp address - %s; pri:%d hold:%d",
                                        __func__, rp_str, rpinfo.rp_pri,
                                        rpinfo.rp_holdtime);
                        }
@@ -1378,7 +1376,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,
                    (buf_size - PIM_BSM_HDR_LEN - PIM_MSG_HEADER_LEN),
                    frag_tag)) {
                if (PIM_DEBUG_BSM) {
-                       zlog_debug("%s, Parsing BSM failed.\r\n", __func__);
+                       zlog_debug("%s, Parsing BSM failed.", __func__);
                }
                pim->bsm_dropped++;
                return -1;
index 7b0af89993c571b2075aecc7b8482e695e443ce5..cb6aae7fae688fe4242e26ce75c5b523afbbc509 100644 (file)
@@ -186,7 +186,7 @@ void pim_register_send(const uint8_t *buf, int buf_size, struct in_addr src,
        if (!pinfo) {
                if (PIM_DEBUG_PIM_REG)
                        zlog_debug(
-                               "%s: Interface: %s not configured for pim to trasmit on!\n",
+                               "%s: Interface: %s not configured for pim to transmit on!",
                                __func__, ifp->name);
                return;
        }
index 5ab52106648cc2e67cf7cb1d4b728d41fae3e729..950690b943d2bd2d4b1f72960d76e38d2524095c 100644 (file)
@@ -1393,7 +1393,7 @@ static int kernel_read(struct thread *thread)
         */
        if (rtm->rtm_msglen != nbytes) {
                zlog_debug(
-                       "kernel_read: rtm->rtm_msglen %d, nbytes %d, type %d\n",
+                       "kernel_read: rtm->rtm_msglen %d, nbytes %d, type %d",
                        rtm->rtm_msglen, nbytes, rtm->rtm_type);
                return -1;
        }
index f1c181438eebb011dc7859d517149a92964df167..c0882c3f355597d095131c6ca4f75830e8c8c377 100644 (file)
@@ -1063,7 +1063,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
 
        if (IS_ZEBRA_DEBUG_NHT)
                zlog_debug(
-                       "rnh_register msg from client %s: hdr->length=%d, type=%s vrf=%u\n",
+                       "rnh_register msg from client %s: hdr->length=%d, type=%s vrf=%u",
                        zebra_route_string(client->proto), hdr->length,
                        (type == RNH_NEXTHOP_TYPE) ? "nexthop" : "route",
                        zvrf->vrf->vrf_id);
@@ -1152,7 +1152,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
 
        if (IS_ZEBRA_DEBUG_NHT)
                zlog_debug(
-                       "rnh_unregister msg from client %s: hdr->length=%d vrf: %u\n",
+                       "rnh_unregister msg from client %s: hdr->length=%d vrf: %u",
                        zebra_route_string(client->proto), hdr->length,
                        zvrf->vrf->vrf_id);