From f74c795033de8d2370e99f25164b04d90698aacf Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 14 Oct 2021 14:09:17 +0200 Subject: [PATCH 1/2] sys/net/uhcp: use LOG_DEBUG instead of LOG_INFO uhcp is pretty noisy compared to DHCPv6 as INFO log level is enabled by default. Tone it down to LOG_DEBUG to keep the output clean. --- sys/net/application_layer/uhcp/uhcp.c | 4 ++-- sys/net/application_layer/uhcp/uhcpc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/application_layer/uhcp/uhcp.c b/sys/net/application_layer/uhcp/uhcp.c index b9dff80a77..935efd1ac2 100644 --- a/sys/net/application_layer/uhcp/uhcp.c +++ b/sys/net/application_layer/uhcp/uhcp.c @@ -17,7 +17,7 @@ void uhcp_handle_udp(uint8_t *buf, size_t len, uint8_t *src, uint16_t port, uhcp { char addr_str[INET6_ADDRSTRLEN]; inet_ntop(AF_INET6, src, addr_str, INET6_ADDRSTRLEN); - LOG_INFO("got packet from %s port %u\n", addr_str, (unsigned)port); + LOG_DEBUG("got packet from %s port %u\n", addr_str, (unsigned)port); if (len < sizeof(uhcp_req_t)) { LOG_ERROR("error: packet too small.\n"); @@ -108,7 +108,7 @@ void uhcp_handle_push(uhcp_push_t *req, uint8_t *src, uint16_t port, uhcp_iface_ inet_ntop(AF_INET6, prefix, prefix_str, INET6_ADDRSTRLEN); - LOG_INFO("uhcp: push from %s:%u prefix=%s/%u\n", addr_str, (unsigned)port, + LOG_DEBUG("uhcp: push from %s:%u prefix=%s/%u\n", addr_str, (unsigned)port, prefix_str, req->prefix_len); uhcp_handle_prefix(prefix, req->prefix_len, 0xFFFF, src, iface); } diff --git a/sys/net/application_layer/uhcp/uhcpc.c b/sys/net/application_layer/uhcp/uhcpc.c index 3b287844f9..62bda2d8fa 100644 --- a/sys/net/application_layer/uhcp/uhcpc.c +++ b/sys/net/application_layer/uhcp/uhcpc.c @@ -46,7 +46,7 @@ void uhcp_client(uhcp_iface_t iface) uint8_t buf[sizeof(uhcp_push_t) + 16]; while(1) { - LOG_INFO("uhcp_client(): sending REQ...\n"); + LOG_DEBUG("uhcp_client(): sending REQ...\n"); sock_udp_send(&sock, &req, sizeof(uhcp_req_t), &req_target); res = sock_udp_recv(&sock, buf, sizeof(buf), 10U*US_PER_SEC, &remote); if (res > 0) { From 35b727c7be94461ce3fc1d844abe96990f74889a Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 14 Oct 2021 14:20:46 +0200 Subject: [PATCH 2/2] sys/net/uhcp: cleanup --- sys/net/application_layer/uhcp/uhcp.c | 2 +- sys/net/application_layer/uhcp/uhcpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/application_layer/uhcp/uhcp.c b/sys/net/application_layer/uhcp/uhcp.c index 935efd1ac2..b21eb7aaf7 100644 --- a/sys/net/application_layer/uhcp/uhcp.c +++ b/sys/net/application_layer/uhcp/uhcp.c @@ -39,7 +39,7 @@ void uhcp_handle_udp(uint8_t *buf, size_t len, uint8_t *src, uint16_t port, uhcp LOG_ERROR("error: wrong protocol version.\n"); } - switch(type) { + switch (type) { #ifdef UHCP_SERVER case UHCP_REQ: if (len < sizeof(uhcp_req_t)) { diff --git a/sys/net/application_layer/uhcp/uhcpc.c b/sys/net/application_layer/uhcp/uhcpc.c index 62bda2d8fa..1dccdfb3f3 100644 --- a/sys/net/application_layer/uhcp/uhcpc.c +++ b/sys/net/application_layer/uhcp/uhcpc.c @@ -45,7 +45,7 @@ void uhcp_client(uhcp_iface_t iface) uint8_t buf[sizeof(uhcp_push_t) + 16]; - while(1) { + while (1) { LOG_DEBUG("uhcp_client(): sending REQ...\n"); sock_udp_send(&sock, &req, sizeof(uhcp_req_t), &req_target); res = sock_udp_recv(&sock, buf, sizeof(buf), 10U*US_PER_SEC, &remote);