From edca5860cbee1adb9e35fa074b4e20d4178c44c7 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 6 Nov 2019 20:17:29 -0500 Subject: [PATCH] ospfd: The ip header dump is crazy long and useless Turning on packet debugs and seeing a header dump that is 11 lines long is useless 2019/11/07 01:07:05.941798 OSPF: ip_v 4 2019/11/07 01:07:05.941806 OSPF: ip_hl 5 2019/11/07 01:07:05.941813 OSPF: ip_tos 192 2019/11/07 01:07:05.941821 OSPF: ip_len 68 2019/11/07 01:07:05.941831 OSPF: ip_id 48576 2019/11/07 01:07:05.941838 OSPF: ip_off 0 2019/11/07 01:07:05.941845 OSPF: ip_ttl 1 2019/11/07 01:07:05.941857 OSPF: ip_p 89 2019/11/07 01:07:05.941865 OSPF: ip_sum 0xcf33 2019/11/07 01:07:05.941873 OSPF: ip_src 200.254.30.14 2019/11/07 01:07:05.941882 OSPF: ip_dst 224.0.0.5 We already have this debugged, it's not going to change and the end developer can stick this back in if needed by hand to debug something that is not working properly. Signed-off-by: Donald Sharp --- ospfd/ospf_dump.c | 17 ----------------- ospfd/ospf_dump.h | 1 - ospfd/ospf_packet.c | 12 ------------ 3 files changed, 30 deletions(-) diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index f74d9733ee..dffcb930e4 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -501,23 +501,6 @@ static void ospf_packet_ls_ack_dump(struct stream *s, uint16_t length) stream_set_getp(s, sp); } -/* Expects header to be in host order */ -void ospf_ip_header_dump(struct ip *iph) -{ - /* IP Header dump. */ - zlog_debug("ip_v %d", iph->ip_v); - zlog_debug("ip_hl %d", iph->ip_hl); - zlog_debug("ip_tos %d", iph->ip_tos); - zlog_debug("ip_len %d", iph->ip_len); - zlog_debug("ip_id %u", (uint32_t)iph->ip_id); - zlog_debug("ip_off %u", (uint32_t)iph->ip_off); - zlog_debug("ip_ttl %d", iph->ip_ttl); - zlog_debug("ip_p %d", iph->ip_p); - zlog_debug("ip_sum 0x%x", (uint32_t)iph->ip_sum); - zlog_debug("ip_src %s", inet_ntoa(iph->ip_src)); - zlog_debug("ip_dst %s", inet_ntoa(iph->ip_dst)); -} - static void ospf_header_dump(struct ospf_header *ospfh) { char buf[9]; diff --git a/ospfd/ospf_dump.h b/ospfd/ospf_dump.h index 09c1811c3c..6b2ebb125a 100644 --- a/ospfd/ospf_dump.h +++ b/ospfd/ospf_dump.h @@ -133,7 +133,6 @@ extern const char *ospf_if_name_string(struct ospf_interface *); extern void ospf_nbr_state_message(struct ospf_neighbor *, char *, size_t); extern const char *ospf_timer_dump(struct thread *, char *, size_t); extern const char *ospf_timeval_dump(struct timeval *, char *, size_t); -extern void ospf_ip_header_dump(struct ip *); extern void ospf_packet_dump(struct stream *); extern void ospf_debug_init(void); diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index a9067e0119..7415c0316a 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -614,13 +614,6 @@ static void ospf_write_frags(int fd, struct ospf_packet *op, struct ip *iph, "ospf_write_frags: sent id %d, off %d, len %d to %s\n", iph->ip_id, iph->ip_off, iph->ip_len, inet_ntoa(iph->ip_dst)); - if (IS_DEBUG_OSPF_PACKET(type - 1, DETAIL)) { - zlog_debug( - "-----------------IP Header Dump----------------------"); - ospf_ip_header_dump(iph); - zlog_debug( - "-----------------------------------------------------"); - } } iph->ip_off += offset; @@ -824,7 +817,6 @@ static int ospf_write(struct thread *thread) if (IS_DEBUG_OSPF_PACKET(type - 1, DETAIL)) { zlog_debug( "-----------------------------------------------------"); - ospf_ip_header_dump(&iph); stream_set_getp(op->s, 0); ospf_packet_dump(op->s); } @@ -2996,10 +2988,6 @@ int ospf_read(struct thread *thread) } } - /* IP Header dump. */ - if (IS_DEBUG_OSPF_PACKET(0, RECV)) - ospf_ip_header_dump(iph); - /* Self-originated packet should be discarded silently. */ if (ospf_if_lookup_by_local_addr(ospf, NULL, iph->ip_src)) { if (IS_DEBUG_OSPF_PACKET(0, RECV)) { -- 2.39.5