mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-11 18:13:40 +08:00
Fix several CLANG format string warnings
This commit is contained in:
@@ -381,7 +381,7 @@ ip4_input(struct pbuf *p, struct netif *inp)
|
||||
/* identify the IP header */
|
||||
iphdr = (struct ip_hdr *)p->payload;
|
||||
if (IPH_V(iphdr) != 4) {
|
||||
LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IP packet dropped due to bad version number %"U16_F"\n", IPH_V(iphdr)));
|
||||
LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IP packet dropped due to bad version number %"U16_F"\n", (u16_t)IPH_V(iphdr)));
|
||||
ip4_debug_print(p);
|
||||
pbuf_free(p);
|
||||
IP_STATS_INC(ip.err);
|
||||
@@ -598,7 +598,7 @@ ip4_input(struct pbuf *p, struct netif *inp)
|
||||
if ((IPH_OFFSET(iphdr) & PP_HTONS(IP_OFFMASK | IP_MF)) != 0) {
|
||||
#if IP_REASSEMBLY /* packet fragment reassembly code present? */
|
||||
LWIP_DEBUGF(IP_DEBUG, ("IP packet is a fragment (id=0x%04"X16_F" tot_len=%"U16_F" len=%"U16_F" MF=%"U16_F" offset=%"U16_F"), calling ip4_reass()\n",
|
||||
ntohs(IPH_ID(iphdr)), p->tot_len, ntohs(IPH_LEN(iphdr)), !!(IPH_OFFSET(iphdr) & PP_HTONS(IP_MF)), (ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)*8));
|
||||
ntohs(IPH_ID(iphdr)), p->tot_len, ntohs(IPH_LEN(iphdr)), (u16_t)!!(IPH_OFFSET(iphdr) & PP_HTONS(IP_MF)), (u16_t)((ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)*8)));
|
||||
/* reassemble the packet*/
|
||||
p = ip4_reass(p);
|
||||
/* packet not fully reassembled yet? */
|
||||
@@ -692,7 +692,7 @@ ip4_input(struct pbuf *p, struct netif *inp)
|
||||
#endif /* LWIP_ICMP */
|
||||
pbuf_free(p);
|
||||
|
||||
LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("Unsupported transport protocol %"U16_F"\n", IPH_PROTO(iphdr)));
|
||||
LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("Unsupported transport protocol %"U16_F"\n", (u16_t)IPH_PROTO(iphdr)));
|
||||
|
||||
IP_STATS_INC(ip.proterr);
|
||||
IP_STATS_INC(ip.drop);
|
||||
@@ -916,7 +916,7 @@ ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *d
|
||||
|
||||
IP_STATS_INC(ip.xmit);
|
||||
|
||||
LWIP_DEBUGF(IP_DEBUG, ("ip4_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], netif->num));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("ip4_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], (u16_t)netif->num));
|
||||
ip4_debug_print(p);
|
||||
|
||||
#if ENABLE_LOOPBACK
|
||||
@@ -1036,21 +1036,21 @@ ip4_debug_print(struct pbuf *p)
|
||||
LWIP_DEBUGF(IP_DEBUG, ("IP header:\n"));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("|%2"S16_F" |%2"S16_F" | 0x%02"X16_F" | %5"U16_F" | (v, hl, tos, len)\n",
|
||||
IPH_V(iphdr),
|
||||
IPH_HL(iphdr),
|
||||
IPH_TOS(iphdr),
|
||||
(u16_t)IPH_V(iphdr),
|
||||
(u16_t)IPH_HL(iphdr),
|
||||
(u16_t)IPH_TOS(iphdr),
|
||||
ntohs(IPH_LEN(iphdr))));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("| %5"U16_F" |%"U16_F"%"U16_F"%"U16_F"| %4"U16_F" | (id, flags, offset)\n",
|
||||
ntohs(IPH_ID(iphdr)),
|
||||
ntohs(IPH_OFFSET(iphdr)) >> 15 & 1,
|
||||
ntohs(IPH_OFFSET(iphdr)) >> 14 & 1,
|
||||
ntohs(IPH_OFFSET(iphdr)) >> 13 & 1,
|
||||
ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK));
|
||||
(u16_t)(ntohs(IPH_OFFSET(iphdr)) >> 15 & 1),
|
||||
(u16_t)(ntohs(IPH_OFFSET(iphdr)) >> 14 & 1),
|
||||
(u16_t)(ntohs(IPH_OFFSET(iphdr)) >> 13 & 1),
|
||||
(u16_t)(ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("| %3"U16_F" | %3"U16_F" | 0x%04"X16_F" | (ttl, proto, chksum)\n",
|
||||
IPH_TTL(iphdr),
|
||||
IPH_PROTO(iphdr),
|
||||
(u16_t)IPH_TTL(iphdr),
|
||||
(u16_t)IPH_PROTO(iphdr),
|
||||
ntohs(IPH_CHKSUM(iphdr))));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));
|
||||
LWIP_DEBUGF(IP_DEBUG, ("| %3"U16_F" | %3"U16_F" | %3"U16_F" | %3"U16_F" | (src)\n",
|
||||
|
||||
@@ -422,12 +422,12 @@ ip6_input(struct pbuf *p, struct netif *inp)
|
||||
if (IP6_HLEN > p->len) {
|
||||
LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
|
||||
("IPv6 header (len %"U16_F") does not fit in first pbuf (len %"U16_F"), IP packet dropped.\n",
|
||||
IP6_HLEN, p->len));
|
||||
(u16_t)IP6_HLEN, p->len));
|
||||
}
|
||||
if ((IP6H_PLEN(ip6hdr) + IP6_HLEN) > p->tot_len) {
|
||||
LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
|
||||
("IPv6 (plen %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n",
|
||||
IP6H_PLEN(ip6hdr) + IP6_HLEN, p->tot_len));
|
||||
(u16_t)(IP6H_PLEN(ip6hdr) + IP6_HLEN), p->tot_len));
|
||||
}
|
||||
/* free (drop) packet pbufs */
|
||||
pbuf_free(p);
|
||||
@@ -755,7 +755,7 @@ options_done:
|
||||
icmp6_param_problem(p, ICMP6_PP_HEADER, ip_data.current_ip_header_tot_len - hlen);
|
||||
}
|
||||
#endif /* LWIP_ICMP */
|
||||
LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_input: Unsupported transport protocol %"U16_F"\n", IP6H_NEXTH(ip6hdr)));
|
||||
LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_input: Unsupported transport protocol %"U16_F"\n", (u16_t)IP6H_NEXTH(ip6hdr)));
|
||||
pbuf_free(p);
|
||||
IP6_STATS_INC(ip6.proterr);
|
||||
IP6_STATS_INC(ip6.drop);
|
||||
@@ -870,7 +870,7 @@ ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
||||
|
||||
IP6_STATS_INC(ip6.xmit);
|
||||
|
||||
LWIP_DEBUGF(IP6_DEBUG, ("ip6_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], netif->num));
|
||||
LWIP_DEBUGF(IP6_DEBUG, ("ip6_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], (u16_t)netif->num));
|
||||
ip6_debug_print(p);
|
||||
|
||||
#if ENABLE_LOOPBACK
|
||||
|
||||
@@ -748,7 +748,7 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len)
|
||||
}
|
||||
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F").\n",
|
||||
len, pcb->rcv_wnd, TCP_WND_MAX(pcb) - pcb->rcv_wnd));
|
||||
len, pcb->rcv_wnd, (u16_t)(TCP_WND_MAX(pcb) - pcb->rcv_wnd)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1948,12 +1948,12 @@ tcp_debug_print(struct tcp_hdr *tcphdr)
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("+-------------------------------+\n"));
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("| %2"U16_F" | |%"U16_F"%"U16_F"%"U16_F"%"U16_F"%"U16_F"%"U16_F"| %5"U16_F" | (hdrlen, flags (",
|
||||
TCPH_HDRLEN(tcphdr),
|
||||
TCPH_FLAGS(tcphdr) >> 5 & 1,
|
||||
TCPH_FLAGS(tcphdr) >> 4 & 1,
|
||||
TCPH_FLAGS(tcphdr) >> 3 & 1,
|
||||
TCPH_FLAGS(tcphdr) >> 2 & 1,
|
||||
TCPH_FLAGS(tcphdr) >> 1 & 1,
|
||||
TCPH_FLAGS(tcphdr) & 1,
|
||||
(u16_t)(TCPH_FLAGS(tcphdr) >> 5 & 1),
|
||||
(u16_t)(TCPH_FLAGS(tcphdr) >> 4 & 1),
|
||||
(u16_t)(TCPH_FLAGS(tcphdr) >> 3 & 1),
|
||||
(u16_t)(TCPH_FLAGS(tcphdr) >> 2 & 1),
|
||||
(u16_t)(TCPH_FLAGS(tcphdr) >> 1 & 1),
|
||||
(u16_t)(TCPH_FLAGS(tcphdr) & 1),
|
||||
ntohs(tcphdr->wnd)));
|
||||
tcp_debug_print_flags(TCPH_FLAGS(tcphdr));
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("), win)\n"));
|
||||
|
||||
@@ -1241,7 +1241,7 @@ tcp_receive(struct tcp_pcb *pcb)
|
||||
m = (s16_t)(tcp_ticks - pcb->rttest);
|
||||
|
||||
LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
|
||||
m, m * TCP_SLOW_INTERVAL));
|
||||
m, (u16_t)(m * TCP_SLOW_INTERVAL)));
|
||||
|
||||
/* This is taken directly from VJs original code in his paper */
|
||||
m = m - (pcb->sa >> 3);
|
||||
@@ -1254,7 +1254,7 @@ tcp_receive(struct tcp_pcb *pcb)
|
||||
pcb->rto = (pcb->sa >> 3) + pcb->sv;
|
||||
|
||||
LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: RTO %"U16_F" (%"U16_F" milliseconds)\n",
|
||||
pcb->rto, pcb->rto * TCP_SLOW_INTERVAL));
|
||||
pcb->rto, (u16_t)(pcb->rto * TCP_SLOW_INTERVAL)));
|
||||
|
||||
pcb->rttest = 0;
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len)
|
||||
/* check for configured max queuelen and possible overflow */
|
||||
if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
|
||||
LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("tcp_write: too long queue %"U16_F" (max %"U16_F")\n",
|
||||
pcb->snd_queuelen, TCP_SND_QUEUELEN));
|
||||
pcb->snd_queuelen, (u16_t)TCP_SND_QUEUELEN));
|
||||
TCP_STATS_INC(tcp.memerr);
|
||||
pcb->flags |= TF_NAGLEMEMERR;
|
||||
return ERR_MEM;
|
||||
@@ -763,7 +763,7 @@ tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)
|
||||
if (((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) &&
|
||||
((flags & TCP_FIN) == 0)) {
|
||||
LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("tcp_enqueue_flags: too long queue %"U16_F" (max %"U16_F")\n",
|
||||
pcb->snd_queuelen, TCP_SND_QUEUELEN));
|
||||
pcb->snd_queuelen, (u16_t)TCP_SND_QUEUELEN));
|
||||
TCP_STATS_INC(tcp.memerr);
|
||||
pcb->flags |= TF_NAGLEMEMERR;
|
||||
return ERR_MEM;
|
||||
@@ -1461,7 +1461,7 @@ tcp_rexmit_fast(struct tcp_pcb *pcb)
|
||||
LWIP_DEBUGF(TCP_FR_DEBUG,
|
||||
("tcp_receive: The minimum value for ssthresh %"TCPWNDSIZE_F
|
||||
" should be min 2 mss %"U16_F"...\n",
|
||||
pcb->ssthresh, 2*pcb->mss));
|
||||
pcb->ssthresh, (u16_t)(2*pcb->mss)));
|
||||
pcb->ssthresh = 2*pcb->mss;
|
||||
}
|
||||
|
||||
@@ -1494,7 +1494,7 @@ tcp_keepalive(struct tcp_pcb *pcb)
|
||||
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",
|
||||
tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
|
||||
tcp_ticks, pcb->tmr, (u16_t)pcb->keep_cnt_sent));
|
||||
|
||||
p = tcp_output_alloc_header(pcb, 0, 0, htonl(pcb->snd_nxt - 1));
|
||||
if (p == NULL) {
|
||||
@@ -1554,7 +1554,7 @@ tcp_zero_window_probe(struct tcp_pcb *pcb)
|
||||
LWIP_DEBUGF(TCP_DEBUG,
|
||||
("tcp_zero_window_probe: tcp_ticks %"U32_F
|
||||
" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
|
||||
tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
|
||||
tcp_ticks, pcb->tmr, (u16_t)pcb->keep_cnt_sent));
|
||||
|
||||
seg = pcb->unacked;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user