]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: remove trailing newlines from zlog messages
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 14 Mar 2019 18:41:15 +0000 (18:41 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 14 Mar 2019 18:41:15 +0000 (18:41 +0000)
Zlog puts its own newlines on, and doing this makes logs look nasty.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
24 files changed:
bgpd/bgp_addpath.c
bgpd/bgp_mplsvpn.c
eigrpd/eigrp_fsm.c
isisd/isis_pdu.c
lib/vrf.c
lib/zclient.c
ospf6d/ospf6_area.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_spf.c
ospfd/ospf_api.c
ospfd/ospf_apiserver.c
ospfd/ospf_ri.c
ospfd/ospf_snmp.c
ospfd/ospf_spf.c
ospfd/ospf_sr.c
pimd/pim_register.c
ripngd/ripng_interface.c
zebra/irdp_main.c
zebra/irdp_packet.c
zebra/kernel_netlink.c
zebra/kernel_socket.c
zebra/rt_netlink.c
zebra/zebra_ptm.c
zebra/zebra_rnh.c

index c7fd1ba0e23e51d7d5707003ba6291102cb3646c..63373cb9a73f5d1e5014711a83daaf86254dee3d 100644 (file)
@@ -384,7 +384,7 @@ void bgp_addpath_set_peer_type(struct peer *peer, afi_t afi, safi_t safi,
                }
        }
 
-       zlog_info("Resetting peer %s%s due to change in addpath config\n",
+       zlog_info("Resetting peer %s%s due to change in addpath config",
                  CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP) ? "group " : "",
                  peer->host);
 
index 765170d1a5f2e222a19541c85593bbfad1734756..446d094c9400779cef06ca0ec1a9bb0c0972fe7b 100644 (file)
@@ -995,7 +995,7 @@ void vpn_leak_from_vrf_withdraw_all(struct bgp *bgp_vpn, /* to */
                                    == bgp_vrf) {
                                        /* delete route */
                                        if (debug)
-                                               zlog_debug("%s: deleting it\n",
+                                               zlog_debug("%s: deleting it",
                                                           __func__);
                                        bgp_aggregate_decrement(bgp_vpn, &bn->p,
                                                                bpi, afi, safi);
index 22f5a5ddb1cb22f0ba525d933673d015ab4394a1..4d6d73e20215df475c73c079cafc29bc935d6a91 100644 (file)
@@ -314,7 +314,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
                        if (prefix->rij->count)
                                return EIGRP_FSM_KEEP_STATE;
 
-                       zlog_info("All reply received\n");
+                       zlog_info("All reply received");
                        if (head->reported_distance < prefix->fdistance) {
                                return EIGRP_FSM_EVENT_LR_FCS;
                        }
@@ -344,7 +344,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
                        } else if (prefix->rij->count) {
                                return EIGRP_FSM_KEEP_STATE;
                        } else {
-                               zlog_info("All reply received\n");
+                               zlog_info("All reply received");
                                return EIGRP_FSM_EVENT_LR;
                        }
                } else if (msg->packet_type == EIGRP_OPC_UPDATE
@@ -366,7 +366,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
                        if (prefix->rij->count) {
                                return EIGRP_FSM_KEEP_STATE;
                        } else {
-                               zlog_info("All reply received\n");
+                               zlog_info("All reply received");
                                if (head->reported_distance
                                    < prefix->fdistance) {
                                        return EIGRP_FSM_EVENT_LR_FCS;
@@ -390,7 +390,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
                        } else if (prefix->rij->count) {
                                return EIGRP_FSM_KEEP_STATE;
                        } else {
-                               zlog_info("All reply received\n");
+                               zlog_info("All reply received");
                                return EIGRP_FSM_EVENT_LR;
                        }
                } else if (msg->packet_type == EIGRP_OPC_UPDATE
index 107de47f3db70803615754966c8d9e28c942dc91..8e9302963dabdd6dd7c0d11d0c21adf893342474 100644 (file)
@@ -131,7 +131,7 @@ static int process_p2p_hello(struct iih_info *iih)
        if (tw_adj) {
                if (tw_adj->state > ISIS_THREEWAY_DOWN) {
                        if (isis->debugs & DEBUG_ADJ_PACKETS) {
-                               zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) with invalid three-way state: %d\n",
+                               zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) with invalid three-way state: %d",
                                           iih->circuit->area->area_tag,
                                           iih->circuit->interface->name,
                                           tw_adj->state);
@@ -144,7 +144,7 @@ static int process_p2p_hello(struct iih_info *iih)
                        || tw_adj->neighbor_circuit_id != (uint32_t) iih->circuit->idx)) {
 
                        if (isis->debugs & DEBUG_ADJ_PACKETS) {
-                               zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) which lists IS/Circuit different from us as neighbor.\n",
+                               zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) which lists IS/Circuit different from us as neighbor.",
                                           iih->circuit->area->area_tag,
                                           iih->circuit->interface->name);
                        }
@@ -1523,7 +1523,7 @@ static int process_snp(uint8_t pdu_type, struct isis_circuit *circuit,
        }
 
        if (fabricd_initial_sync_is_complete(circuit->area) && resync_needed)
-               zlog_warn("OpenFabric: Needed to resync LSPDB using CSNP!\n");
+               zlog_warn("OpenFabric: Needed to resync LSPDB using CSNP!");
 
        retval = ISIS_OK;
 out:
index df93bc33b948e0c6c04e2d96967852f7b0ebda38..ab47f242fd0468afa7457908bcab9c7cb3a236c2 100644 (file)
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -662,7 +662,7 @@ int vrf_netns_handler_create(struct vty *vty, struct vrf *vrf, char *pathname,
                                "VRF %u is already configured with VRF %s\n",
                                vrf->vrf_id, vrf->name);
                else
-                       zlog_info("VRF %u is already configured with VRF %s\n",
+                       zlog_info("VRF %u is already configured with VRF %s",
                                  vrf->vrf_id, vrf->name);
                return CMD_WARNING_CONFIG_FAILED;
        }
index 9db1dd74f2d91421a679ffbbfa8778ee13b84fcf..55f2393c563b01867f31ee01d3a474feb651ba14 100644 (file)
@@ -2504,7 +2504,7 @@ static int zclient_read(struct thread *thread)
        length -= ZEBRA_HEADER_SIZE;
 
        if (zclient_debug)
-               zlog_debug("zclient 0x%p command 0x%x VRF %u\n",
+               zlog_debug("zclient 0x%p command 0x%x VRF %u",
                           (void *)zclient, command, vrf_id);
 
        switch (command) {
@@ -2574,14 +2574,14 @@ static int zclient_read(struct thread *thread)
                break;
        case ZEBRA_NEXTHOP_UPDATE:
                if (zclient_debug)
-                       zlog_debug("zclient rcvd nexthop update\n");
+                       zlog_debug("zclient rcvd nexthop update");
                if (zclient->nexthop_update)
                        (*zclient->nexthop_update)(command, zclient, length,
                                                   vrf_id);
                break;
        case ZEBRA_IMPORT_CHECK_UPDATE:
                if (zclient_debug)
-                       zlog_debug("zclient rcvd import check update\n");
+                       zlog_debug("zclient rcvd import check update");
                if (zclient->import_check_update)
                        (*zclient->import_check_update)(command, zclient,
                                                        length, vrf_id);
@@ -2608,7 +2608,7 @@ static int zclient_read(struct thread *thread)
                break;
        case ZEBRA_FEC_UPDATE:
                if (zclient_debug)
-                       zlog_debug("zclient rcvd fec update\n");
+                       zlog_debug("zclient rcvd fec update");
                if (zclient->fec_update)
                        (*zclient->fec_update)(command, zclient, length);
                break;
index 76722aad1028550c37df5510352adfaa11cfb892..484e5adae674a3ab044629e0b346d0dad7640fa5 100644 (file)
@@ -138,11 +138,11 @@ static void ospf6_area_stub_update(struct ospf6_area *area)
 
        if (IS_AREA_STUB(area)) {
                if (IS_OSPF6_DEBUG_ORIGINATE(ROUTER))
-                       zlog_debug("Stubbing out area for if %s\n", area->name);
+                       zlog_debug("Stubbing out area for if %s", area->name);
                OSPF6_OPT_CLEAR(area->options, OSPF6_OPT_E);
        } else if (IS_AREA_ENABLED(area)) {
                if (IS_OSPF6_DEBUG_ORIGINATE(ROUTER))
-                       zlog_debug("Normal area for if %s\n", area->name);
+                       zlog_debug("Normal area for if %s", area->name);
                OSPF6_OPT_SET(area->options, OSPF6_OPT_E);
                ospf6_asbr_send_externals_to_area(area);
        }
@@ -450,7 +450,7 @@ DEFUN (area_range,
 
        range->path.u.cost_config = cost;
 
-       zlog_debug("%s: for prefix %s, flag = %x\n", __func__,
+       zlog_debug("%s: for prefix %s, flag = %x", __func__,
                   argv[idx_ipv6_prefixlen]->arg, range->flag);
        if (range->rnode == NULL) {
                ospf6_route_add(range, oa->range_table);
index 3153c29aa18ae66998f3b68435536a78f8b0b68a..2795bb9abdfb46c99ad369bb6d162bd359e8cea9 100644 (file)
@@ -1006,7 +1006,7 @@ void ospf6_asbr_send_externals_to_area(struct ospf6_area *oa)
 
        for (ALL_LSDB(oa->ospf6->lsdb, lsa)) {
                if (ntohs(lsa->header->type) == OSPF6_LSTYPE_AS_EXTERNAL) {
-                       zlog_debug("%s: Flooding AS-External LSA %s\n",
+                       zlog_debug("%s: Flooding AS-External LSA %s",
                                   __func__, lsa->name);
                        ospf6_flood_area(NULL, lsa, oa);
                }
index d4f6f6f4aebb287b1fde2cf6b8839ed3a835d048..f08426fb47994173b10b32250230d44c6330ba2e 100644 (file)
@@ -475,7 +475,7 @@ void ospf6_spf_calculation(uint32_t router_id,
        lsa = ospf6_create_single_router_lsa(oa, oa->lsdb_self, router_id);
        if (lsa == NULL) {
                if (IS_OSPF6_DEBUG_SPF(PROCESS))
-                       zlog_debug("%s: No router LSA for area %s\n", __func__,
+                       zlog_debug("%s: No router LSA for area %s", __func__,
                                   oa->name);
                return;
        }
index a3b337a0c0b782dbd7caabb95af8ada37ee43d1a..f06e45392eb09968afe4692c93f29daf7c1fd23e 100644 (file)
@@ -74,12 +74,12 @@ void api_opaque_lsa_print(struct lsa_header *data)
        olsa = (struct opaque_lsa *)data;
 
        opaquelen = ntohs(data->length) - OSPF_LSA_HEADER_SIZE;
-       zlog_debug("apiserver_lsa_print: opaquelen=%d\n", opaquelen);
+       zlog_debug("apiserver_lsa_print: opaquelen=%d", opaquelen);
 
        for (i = 0; i < opaquelen; i++) {
                zlog_debug("0x%x ", olsa->mydata[i]);
        }
-       zlog_debug("\n");
+       zlog_debug(" ");
 }
 
 /* -----------------------------------------------------------
@@ -242,7 +242,7 @@ const char *ospf_api_errname(int errcode)
 void msg_print(struct msg *msg)
 {
        if (!msg) {
-               zlog_debug("msg_print msg=NULL!\n");
+               zlog_debug("msg_print msg=NULL!");
                return;
        }
 
index d0ee8187229535f9c1f060b6028fdc388da94e33..6b9ff6556c4b428657b943bd1e0144a1899c3c5f 100644 (file)
@@ -2024,7 +2024,7 @@ int ospf_apiserver_del_if(struct interface *ifp)
 
        /* zlog_warn for debugging */
        zlog_warn("ospf_apiserver_del_if");
-       zlog_warn("ifp name=%s status=%d index=%d\n", ifp->name, ifp->status,
+       zlog_warn("ifp name=%s status=%d index=%d", ifp->name, ifp->status,
                  ifp->ifindex);
 
        oi = ospf_apiserver_if_lookup_by_ifp(ifp);
@@ -2110,7 +2110,7 @@ void ospf_apiserver_show_info(struct vty *vty, struct ospf_lsa *lsa)
                for (i = 0; i < opaquelen; i++) {
                        zlog_debug("0x%x ", olsa->data[i]);
                }
-               zlog_debug("\n");
+               zlog_debug("");
        }
        return;
 }
index 4a0d4add150859818160fb5b4677d9c3fcae09e7..5f01edfbdfa75889d454c91d767b62e7a812133a 100644 (file)
@@ -1372,14 +1372,14 @@ static uint16_t show_vty_sr_algorithm(struct vty *vty, struct tlv_header *tlvh)
        }
 
        else {
-               zlog_debug("  Segment Routing Algorithm TLV:\n");
+               zlog_debug("  Segment Routing Algorithm TLV:");
                for (i = 0; i < ntohs(algo->header.length); i++)
                        switch (algo->value[i]) {
                        case 0:
-                               zlog_debug("    Algorithm %d: SPF\n", i);
+                               zlog_debug("    Algorithm %d: SPF", i);
                                break;
                        case 1:
-                               zlog_debug("    Algorithm %d: Strict SPF\n", i);
+                               zlog_debug("    Algorithm %d: Strict SPF", i);
                                break;
                        default:
                                zlog_debug(
index f068efc8dbf0c6d005016df97960c935a0335490..c26545344a9f5818213fb16d2eab3f90e0eb52f7 100644 (file)
@@ -901,7 +901,7 @@ static struct ospf_lsa *lsdb_lookup_next(struct ospf_area *area, uint8_t *type,
        /* Sanity check, if LSA type unknwon
           merley skip any LSA */
        if ((i < OSPF_MIN_LSA) || (i >= OSPF_MAX_LSA)) {
-               zlog_debug("Strange request with LSA type %d\n", i);
+               zlog_debug("Strange request with LSA type %d", i);
                return NULL;
        }
 
index 9c223facd354b4326175c11d5ece75814c4eab7e..74dba273e619815fb89c9931ec250f0639ff6f74 100644 (file)
@@ -1140,13 +1140,13 @@ ospf_rtrs_print (struct route_table *rtrs)
               if (path->nexthop.s_addr == 0)
                 {
                   if (IS_DEBUG_OSPF_EVENT)
-                    zlog_debug ("   directly attached to %s\r\n",
+                    zlog_debug ("   directly attached to %s\r",
                                ifindex2ifname (path->ifindex), VRF_DEFAULT);
                 }
               else
                 {
                   if (IS_DEBUG_OSPF_EVENT)
-                    zlog_debug ("   via %s, %s\r\n",
+                    zlog_debug ("   via %s, %s\r",
                                inet_ntoa (path->nexthop),
                                ifindex2ifname (path->ifindex), VRF_DEFAULT);
                 }
index f0ddf7cc0a3e57ae47fc8e66cb0f3c62b82f1b43..a49352086828ef72692f70d72de54638459c265d 100644 (file)
@@ -1600,7 +1600,7 @@ static int ospf_sr_update_schedule(struct thread *t)
        monotime(&stop_time);
 
        if (IS_DEBUG_OSPF_SR)
-               zlog_debug("SR (%s): SPF Processing Time(usecs): %lld\n",
+               zlog_debug("SR (%s): SPF Processing Time(usecs): %lld",
                           __func__,
                           (stop_time.tv_sec - start_time.tv_sec) * 1000000LL
                                   + (stop_time.tv_usec - start_time.tv_usec));
index 4b402de6348e10f651b396ac3b2dd7fd9b2d3f5c..a4965b8ffe43733081adacf7908d731ec36cf2a3 100644 (file)
@@ -97,7 +97,7 @@ void pim_register_stop_send(struct interface *ifp, struct prefix_sg *sg,
        pinfo = (struct pim_interface *)ifp->info;
        if (!pinfo) {
                if (PIM_DEBUG_PIM_TRACE)
-                       zlog_debug("%s: No pinfo!\n", __PRETTY_FUNCTION__);
+                       zlog_debug("%s: No pinfo!", __PRETTY_FUNCTION__);
                return;
        }
        if (pim_msg_send(pinfo->pim_sock_fd, src, originator, buffer,
index e5dc6e6af69ccefb906185ca3804b0d623c13a90..ea32b622a6ac530720b4b31ebb18bc0175f44931 100644 (file)
@@ -90,7 +90,7 @@ static int ripng_multicast_join(struct interface *ifp)
                         * group on
                         * an interface that has just gone down.
                         */
-                       zlog_warn("ripng join on %s EADDRINUSE (ignoring)\n",
+                       zlog_warn("ripng join on %s EADDRINUSE (ignoring)",
                                  ifp->name);
                        return 0; /* not an error */
                }
@@ -124,7 +124,7 @@ static int ripng_multicast_leave(struct interface *ifp)
                ret = setsockopt(ripng->sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
                                 (char *)&mreq, sizeof(mreq));
                if (ret < 0)
-                       zlog_warn("can't setsockopt IPV6_LEAVE_GROUP: %s\n",
+                       zlog_warn("can't setsockopt IPV6_LEAVE_GROUP: %s",
                                  safe_strerror(errno));
 
                if (IS_RIPNG_DEBUG_EVENT)
index a9734056bc09e320387ef932b2d89b9c47498ef1..38d241eaa5b45c5624109281b878878096bc07a3 100644 (file)
@@ -241,7 +241,7 @@ int irdp_send_thread(struct thread *t_advert)
                timer = MAX_INITIAL_ADVERT_INTERVAL;
 
        if (irdp->flags & IF_DEBUG_MISC)
-               zlog_debug("IRDP: New timer for %s set to %u\n", ifp->name,
+               zlog_debug("IRDP: New timer for %s set to %u", ifp->name,
                           timer);
 
        irdp->t_advertise = NULL;
index 774d84d66d87bd1274029bb5755e5c32bdab8033..2804787620ab6ff8d9be38264fa1ae6969ea25e6 100644 (file)
@@ -166,7 +166,7 @@ static void parse_irdp_packet(char *p, int len, struct interface *ifp)
        case ICMP_ROUTERSOLICIT:
 
                if (irdp->flags & IF_DEBUG_MESSAGES)
-                       zlog_debug("IRDP: RX Solicit on %s from %s\n",
+                       zlog_debug("IRDP: RX Solicit on %s from %s",
                                   ifp->name, inet_ntoa(src));
 
                process_solicit(ifp);
@@ -253,7 +253,7 @@ int irdp_read_raw(struct thread *r)
        if (!(irdp->flags & IF_ACTIVE)) {
 
                if (irdp->flags & IF_DEBUG_MISC)
-                       zlog_debug("IRDP: RX ICMP for disabled interface %s\n",
+                       zlog_debug("IRDP: RX ICMP for disabled interface %s",
                                   ifp->name);
                return 0;
        }
index 2f850c6338d51a9fdf7916a6bf264896d171ee6a..c5fbfd44814aad9a8f53b4220a8e11110ab93b0d 100644 (file)
@@ -652,7 +652,7 @@ static void netlink_parse_extended_ack(struct nlmsghdr *h)
                off = *(uint32_t *)RTA_DATA(tb[NLMSGERR_ATTR_OFFS]);
 
                if (off > h->nlmsg_len) {
-                       zlog_err("Invalid offset for NLMSGERR_ATTR_OFFS\n");
+                       zlog_err("Invalid offset for NLMSGERR_ATTR_OFFS");
                } else if (!(h->nlmsg_flags & NLM_F_CAPPED)) {
                        /*
                         * Header of failed message
index 792756efebdbaf161b5ea7a21e7d2ea8012fff51..ad461919038b162f1d76099e7b66bb8513bd3ea7 100644 (file)
@@ -622,7 +622,7 @@ int ifm_read(struct if_msghdr *ifm)
                 * RTA_IFP) is required.
                 */
                if (!ifnlen) {
-                       zlog_debug("Interface index %d (new) missing ifname\n",
+                       zlog_debug("Interface index %d (new) missing ifname",
                                   ifm->ifm_index);
                        return -1;
                }
index c56e2f316d411a8b0e32771369bd899f5fc5f102..cf61eb6cb48b2d7acd8bae2e4f20d2086fdc7d7d 100644 (file)
@@ -835,7 +835,7 @@ int netlink_route_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
 
        if (!(h->nlmsg_type == RTM_NEWROUTE || h->nlmsg_type == RTM_DELROUTE)) {
                /* If this is not route add/delete message print warning. */
-               zlog_debug("Kernel message: %s NS %u\n",
+               zlog_debug("Kernel message: %s NS %u",
                           nl_msg_type_to_str(h->nlmsg_type), ns_id);
                return 0;
        }
index cc5e38e690df9bf3389790eed6e898cf14440bed..bb352dc2ffd698fb3176500324cbf928b4c7979c 100644 (file)
@@ -328,7 +328,7 @@ DEFUN (zebra_ptm_enable_if,
        if (!old_ptm_enable && ptm_cb.ptm_enable) {
                if (!if_is_operative(ifp) && send_linkdown) {
                        if (IS_ZEBRA_DEBUG_EVENT)
-                               zlog_debug("%s: Bringing down interface %s\n",
+                               zlog_debug("%s: Bringing down interface %s",
                                           __func__, ifp->name);
                        if_down(ifp);
                }
@@ -354,7 +354,7 @@ DEFUN (no_zebra_ptm_enable_if,
                ifp->ptm_enable = ZEBRA_IF_PTM_ENABLE_OFF;
                if (if_is_no_ptm_operative(ifp) && send_linkup) {
                        if (IS_ZEBRA_DEBUG_EVENT)
-                               zlog_debug("%s: Bringing up interface %s\n",
+                               zlog_debug("%s: Bringing up interface %s",
                                           __func__, ifp->name);
                        if_up(ifp);
                }
index 52637c6062d01ee4679cb17ec3f198f1bdf34f66..f601ab7e7bc6c9cd93f5b62f2c458a04ff15d154 100644 (file)
@@ -383,7 +383,7 @@ static void zebra_rnh_eval_import_check_entry(vrf_id_t vrfid, afi_t afi,
        if (state_changed || force) {
                if (IS_ZEBRA_DEBUG_NHT) {
                        prefix2str(&nrn->p, bufn, INET6_ADDRSTRLEN);
-                       zlog_debug("%u:%s: Route import check %s %s\n", vrfid,
+                       zlog_debug("%u:%s: Route import check %s %s", vrfid,
                                   bufn, rnh->state ? "passed" : "failed",
                                   state_changed ? "(state changed)" : "");
                }
@@ -775,7 +775,7 @@ void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
 
        table = get_rnh_table(vrfid, afi, type);
        if (!table) {
-               zlog_debug("print_rnhs: rnh table not found\n");
+               zlog_debug("print_rnhs: rnh table not found");
                return;
        }
 
@@ -1025,7 +1025,7 @@ static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi,
 
        ntable = get_rnh_table(vrf_id, afi, type);
        if (!ntable) {
-               zlog_debug("cleanup_rnh_client: rnh table not found\n");
+               zlog_debug("cleanup_rnh_client: rnh table not found");
                return -1;
        }