From 11da4ef024db33b05decb7f6f70ebfdc6ffdd73e Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 21 Jun 2017 13:26:55 +0200 Subject: [PATCH] Use ip_addr_debug_print_val instead of ip_addr_debug_print where applicable --- src/api/sockets.c | 6 +++--- src/core/dns.c | 4 ++-- src/core/tcp.c | 2 +- src/core/tcp_out.c | 4 ++-- src/core/udp.c | 14 +++++++------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index cfbbd979..3dfab008 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -989,7 +989,7 @@ lwip_recv_tcp_from(struct lwip_sock *sock, struct sockaddr *from, socklen_t *fro ip_addr_t tmpaddr; netconn_getaddr(sock->conn, &tmpaddr, &port, 0); LWIP_DEBUGF(SOCKETS_DEBUG, ("%s(%d): addr=", dbg_fn, dbg_s)); - ip_addr_debug_print(SOCKETS_DEBUG, &tmpaddr); + ip_addr_debug_print_val(SOCKETS_DEBUG, tmpaddr); LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%d\n", port, (int)dbg_ret)); if (from && fromlen) { return lwip_sock_make_addr(sock->conn, &tmpaddr, port, from, fromlen); @@ -1061,7 +1061,7 @@ lwip_recvfrom_udp_raw(struct lwip_sock *sock, int flags, struct msghdr *msg, u16 #endif /* !SOCKETS_DEBUG */ { LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom_udp_raw(%d): addr=", dbg_s)); - ip_addr_debug_print(SOCKETS_DEBUG, netbuf_fromaddr(buf)); + ip_addr_debug_print_val(SOCKETS_DEBUG, *netbuf_fromaddr(buf)); LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%d\n", netbuf_fromport(buf), copied)); if (msg->msg_name && msg->msg_namelen) { lwip_sock_make_addr(sock->conn, netbuf_fromaddr(buf), netbuf_fromport(buf), @@ -1538,7 +1538,7 @@ lwip_sendto(int s, const void *data, size_t size, int flags, LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_sendto(%d, data=%p, short_size=%"U16_F", flags=0x%x to=", s, data, short_size, flags)); - ip_addr_debug_print(SOCKETS_DEBUG, &buf.addr); + ip_addr_debug_print_val(SOCKETS_DEBUG, buf.addr); LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F"\n", remote_port)); /* make the buffer point to the data that should be sent */ diff --git a/src/core/dns.c b/src/core/dns.c index 42988890..d18c51f6 100644 --- a/src/core/dns.c +++ b/src/core/dns.c @@ -622,7 +622,7 @@ dns_lookup(const char *name, ip_addr_t *addr LWIP_DNS_ADDRTYPE_ARG(u8_t dns_addr (lwip_strnicmp(name, dns_table[i].name, sizeof(dns_table[i].name)) == 0) && LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, dns_table[i].ipaddr)) { LWIP_DEBUGF(DNS_DEBUG, ("dns_lookup: \"%s\": found = ", name)); - ip_addr_debug_print(DNS_DEBUG, &(dns_table[i].ipaddr)); + ip_addr_debug_print_val(DNS_DEBUG, dns_table[i].ipaddr); LWIP_DEBUGF(DNS_DEBUG, ("\n")); if (addr) { ip_addr_copy(*addr, dns_table[i].ipaddr); @@ -1103,7 +1103,7 @@ dns_correct_response(u8_t idx, u32_t ttl) entry->state = DNS_STATE_DONE; LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response = ", entry->name)); - ip_addr_debug_print(DNS_DEBUG, (&(entry->ipaddr))); + ip_addr_debug_print_val(DNS_DEBUG, entry->ipaddr); LWIP_DEBUGF(DNS_DEBUG, ("\n")); /* read the answer resource record's TTL, and maximize it if needed */ diff --git a/src/core/tcp.c b/src/core/tcp.c index 2ba8bb26..72ff08a1 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1153,7 +1153,7 @@ tcp_slowtmr_start: (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL) { LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to ")); - ip_addr_debug_print(TCP_DEBUG, &pcb->remote_ip); + ip_addr_debug_print_val(TCP_DEBUG, pcb->remote_ip); LWIP_DEBUGF(TCP_DEBUG, ("\n")); ++pcb_remove; diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 633b6c1b..1ea65144 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -1563,7 +1563,7 @@ tcp_keepalive(struct tcp_pcb *pcb) struct netif *netif; LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: sending KEEPALIVE probe to ")); - ip_addr_debug_print(TCP_DEBUG, &pcb->remote_ip); + ip_addr_debug_print_val(TCP_DEBUG, pcb->remote_ip); LWIP_DEBUGF(TCP_DEBUG, ("\n")); LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", @@ -1622,7 +1622,7 @@ tcp_zero_window_probe(struct tcp_pcb *pcb) struct netif *netif; LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: sending ZERO WINDOW probe to ")); - ip_addr_debug_print(TCP_DEBUG, &pcb->remote_ip); + ip_addr_debug_print_val(TCP_DEBUG, pcb->remote_ip); LWIP_DEBUGF(TCP_DEBUG, ("\n")); LWIP_DEBUGF(TCP_DEBUG, diff --git a/src/core/udp.c b/src/core/udp.c index 9c067d6b..69868897 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -230,9 +230,9 @@ udp_input(struct pbuf *p, struct netif *inp) /* print the UDP source and destination */ LWIP_DEBUGF(UDP_DEBUG, ("udp (")); - ip_addr_debug_print(UDP_DEBUG, ip_current_dest_addr()); + ip_addr_debug_print_val(UDP_DEBUG, *ip_current_dest_addr()); LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F") <-- (", lwip_ntohs(udphdr->dest))); - ip_addr_debug_print(UDP_DEBUG, ip_current_src_addr()); + ip_addr_debug_print_val(UDP_DEBUG, *ip_current_src_addr()); LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F")\n", lwip_ntohs(udphdr->src))); pcb = NULL; @@ -245,9 +245,9 @@ udp_input(struct pbuf *p, struct netif *inp) for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { /* print the PCB local and remote address */ LWIP_DEBUGF(UDP_DEBUG, ("pcb (")); - ip_addr_debug_print(UDP_DEBUG, &pcb->local_ip); + ip_addr_debug_print_val(UDP_DEBUG, pcb->local_ip); LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F") <-- (", pcb->local_port)); - ip_addr_debug_print(UDP_DEBUG, &pcb->remote_ip); + ip_addr_debug_print_val(UDP_DEBUG, pcb->remote_ip); LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F")\n", pcb->remote_port)); /* compare PCB local addr+port to UDP destination addr+port */ @@ -974,7 +974,7 @@ udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) udp_pcbs = pcb; } LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("udp_bind: bound to ")); - ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, &pcb->local_ip); + ip_addr_debug_print_val(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, pcb->local_ip); LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (", port %"U16_F")\n", pcb->local_port)); return ERR_OK; } @@ -1049,8 +1049,8 @@ udp_connect(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) pcb->flags |= UDP_FLAGS_CONNECTED; LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("udp_connect: connected to ")); - ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, - &pcb->remote_ip); + ip_addr_debug_print_val(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + pcb->remote_ip); LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (", port %"U16_F")\n", pcb->remote_port)); /* Insert UDP PCB into the list of active UDP PCBs. */