diff --git a/contrib/ports/win32/pcapif.c b/contrib/ports/win32/pcapif.c index be0fb7bf..3066abd0 100644 --- a/contrib/ports/win32/pcapif.c +++ b/contrib/ports/win32/pcapif.c @@ -732,7 +732,7 @@ pcapif_low_level_init(struct netif *netif) adapter_num = (LWIP_PTR_NUMERIC_CAST(int, netif->state)) - 1; if (adapter_num < 0) { printf("ERROR: invalid adapter index \"%d\"!\n", adapter_num); - LWIP_ASSERT("ERROR initializing network adapter!\n", 0); + LWIP_ASSERT("ERROR initializing network adapter!", 0); return; } } @@ -758,7 +758,7 @@ pcapif_low_level_init(struct netif *netif) adapter_num = get_adapter_index(PACKET_LIB_ADAPTER_GUID); if (adapter_num < 0) { printf("ERROR finding network adapter with GUID \"%s\"!\n", PACKET_LIB_ADAPTER_GUID); - LWIP_ASSERT("ERROR initializing network adapter!\n", 0); + LWIP_ASSERT("ERROR initializing network adapter!", 0); return; } #endif /* PACKET_LIB_ADAPTER_GUID */ diff --git a/src/core/ipv4/icmp.c b/src/core/ipv4/icmp.c index de6d1e85..cee48c53 100644 --- a/src/core/ipv4/icmp.c +++ b/src/core/ipv4/icmp.c @@ -179,7 +179,7 @@ icmp_input(struct pbuf *p, struct netif *inp) MEMCPY(r->payload, iphdr_in, hlen); /* switch r->payload back to icmp header (cannot fail) */ if (pbuf_remove_header(r, hlen)) { - LWIP_ASSERT("icmp_input: moving r->payload to icmp header failed\n", 0); + LWIP_ASSERT("icmp_input: moving r->payload to icmp header failed", 0); pbuf_free(r); goto icmperr; } @@ -196,7 +196,7 @@ icmp_input(struct pbuf *p, struct netif *inp) } else { /* restore p->payload to point to icmp header (cannot fail) */ if (pbuf_remove_header(p, hlen + PBUF_LINK_HLEN + PBUF_LINK_ENCAPSULATION_HLEN)) { - LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0); + LWIP_ASSERT("icmp_input: restoring original p->payload failed", 0); goto icmperr; } } diff --git a/src/core/ipv6/ip6_frag.c b/src/core/ipv6/ip6_frag.c index 8b352f56..6617e0d2 100644 --- a/src/core/ipv6/ip6_frag.c +++ b/src/core/ipv6/ip6_frag.c @@ -166,7 +166,7 @@ ip6_reass_free_complete_datagram(struct ip6_reassdata *ipr) /* Then, move back to the original ipv6 header (we are now pointing to Fragment header). This cannot fail since we already checked when receiving this fragment. */ if (pbuf_header_force(p, (s16_t)((u8_t*)p->payload - (u8_t*)ipr->iphdr))) { - LWIP_ASSERT("ip6_reass_free: moving p->payload to ip6 header failed\n", 0); + LWIP_ASSERT("ip6_reass_free: moving p->payload to ip6 header failed", 0); } else { /* Reconstruct the zoned source and destination addresses, so that we do @@ -652,7 +652,7 @@ ip6_reass(struct pbuf *p) /* Move pbuf back to IPv6 header. This should never fail. */ if (pbuf_header_force(p, (s16_t)((u8_t*)p->payload - (u8_t*)iphdr_ptr))) { - LWIP_ASSERT("ip6_reass: moving p->payload to ip6 header failed\n", 0); + LWIP_ASSERT("ip6_reass: moving p->payload to ip6 header failed", 0); pbuf_free(p); return NULL; } diff --git a/src/core/tcp.c b/src/core/tcp.c index 5a62c556..c600ad5d 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1215,9 +1215,9 @@ tcp_slowtmr_start: } while (pcb != NULL) { LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n")); - LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED); - LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN); - LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT); + LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED", pcb->state != CLOSED); + LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN", pcb->state != LISTEN); + LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT); if (pcb->last_timer == tcp_timer_ctr) { /* skip this pcb, we have already processed it */ prev = pcb; diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 90061281..dba4c374 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -1486,7 +1486,7 @@ tcp_receive(struct tcp_pcb *pcb) } pbuf_realloc(inseg.p, inseg.len); tcplen = TCP_TCPLEN(&inseg); - LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd\n", + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd", (seqno + tcplen) == (pcb->rcv_nxt + pcb->rcv_wnd)); } #if TCP_QUEUE_OOSEQ @@ -1535,7 +1535,7 @@ tcp_receive(struct tcp_pcb *pcb) } pbuf_realloc(inseg.p, inseg.len); tcplen = TCP_TCPLEN(&inseg); - LWIP_ASSERT("tcp_receive: segment not trimmed correctly to ooseq queue\n", + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to ooseq queue", (seqno + tcplen) == next->tcphdr->seqno); } pcb->ooseq = next; @@ -1546,7 +1546,7 @@ tcp_receive(struct tcp_pcb *pcb) pcb->rcv_nxt = seqno + tcplen; /* Update the receiver's (our) window. */ - LWIP_ASSERT("tcp_receive: tcplen > rcv_wnd\n", pcb->rcv_wnd >= tcplen); + LWIP_ASSERT("tcp_receive: tcplen > rcv_wnd", pcb->rcv_wnd >= tcplen); pcb->rcv_wnd -= tcplen; tcp_update_rcv_ann_wnd(pcb); @@ -1582,7 +1582,7 @@ tcp_receive(struct tcp_pcb *pcb) seqno = pcb->ooseq->tcphdr->seqno; pcb->rcv_nxt += TCP_TCPLEN(cseg); - LWIP_ASSERT("tcp_receive: ooseq tcplen > rcv_wnd\n", + LWIP_ASSERT("tcp_receive: ooseq tcplen > rcv_wnd", pcb->rcv_wnd >= TCP_TCPLEN(cseg)); pcb->rcv_wnd -= TCP_TCPLEN(cseg); @@ -1787,7 +1787,7 @@ tcp_receive(struct tcp_pcb *pcb) next->next->len = (u16_t)(pcb->rcv_nxt + pcb->rcv_wnd - seqno); pbuf_realloc(next->next->p, next->next->len); tcplen = TCP_TCPLEN(next->next); - LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd\n", + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd", (seqno + tcplen) == (pcb->rcv_nxt + pcb->rcv_wnd)); } } diff --git a/src/core/udp.c b/src/core/udp.c index 96796884..dbc88ee7 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -365,7 +365,7 @@ udp_input(struct pbuf *p, struct netif *inp) #endif /* CHECKSUM_CHECK_UDP */ if (pbuf_remove_header(p, UDP_HLEN)) { /* Can we cope with this failing? Just assert for now */ - LWIP_ASSERT("pbuf_remove_header failed\n", 0); + LWIP_ASSERT("pbuf_remove_header failed", 0); UDP_STATS_INC(udp.drop); MIB2_STATS_INC(mib2.udpinerrors); pbuf_free(p); diff --git a/src/include/lwip/priv/tcp_priv.h b/src/include/lwip/priv/tcp_priv.h index c84b5be8..e9fbfd93 100644 --- a/src/include/lwip/priv/tcp_priv.h +++ b/src/include/lwip/priv/tcp_priv.h @@ -358,7 +358,7 @@ extern struct tcp_pcb ** const tcp_pcb_lists[NUM_TCP_PCB_LISTS]; for (tcp_tmp_pcb = *(pcbs); \ tcp_tmp_pcb != NULL; \ tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - LWIP_ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != (npcb)); \ + LWIP_ASSERT("TCP_REG: already registered", tcp_tmp_pcb != (npcb)); \ } \ LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", ((pcbs) == &tcp_bound_pcbs) || ((npcb)->state != CLOSED)); \ (npcb)->next = *(pcbs); \ diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index dff02554..7992388e 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -719,7 +719,7 @@ static void pppos_input_callback(void *arg) { ppp = ((struct pppos_input_header*)pb->payload)->ppp; if(pbuf_remove_header(pb, sizeof(struct pppos_input_header))) { - LWIP_ASSERT("pbuf_remove_header failed\n", 0); + LWIP_ASSERT("pbuf_remove_header failed", 0); goto drop; } diff --git a/src/netif/ppp/vj.c b/src/netif/ppp/vj.c index b322ee4a..11df6f9c 100644 --- a/src/netif/ppp/vj.c +++ b/src/netif/ppp/vj.c @@ -409,7 +409,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb) hlen -= deltaS + 4; if (pbuf_remove_header(np, hlen)){ /* Can we cope with this failing? Just assert for now */ - LWIP_ASSERT("pbuf_remove_header failed\n", 0); + LWIP_ASSERT("pbuf_remove_header failed", 0); } cp = (u8_t*)np->payload; *cp++ = (u8_t)(changes | NEW_C); @@ -418,7 +418,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb) hlen -= deltaS + 3; if (pbuf_remove_header(np, hlen)) { /* Can we cope with this failing? Just assert for now */ - LWIP_ASSERT("pbuf_remove_header failed\n", 0); + LWIP_ASSERT("pbuf_remove_header failed", 0); } cp = (u8_t*)np->payload; *cp++ = (u8_t)changes; @@ -621,7 +621,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) /* Remove the compressed header and prepend the uncompressed header. */ if (pbuf_remove_header(n0, vjlen)) { /* Can we cope with this failing? Just assert for now */ - LWIP_ASSERT("pbuf_remove_header failed\n", 0); + LWIP_ASSERT("pbuf_remove_header failed", 0); goto bad; } @@ -644,7 +644,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) if (pbuf_remove_header(np, cs->cs_hlen)) { /* Can we cope with this failing? Just assert for now */ - LWIP_ASSERT("pbuf_remove_header failed\n", 0); + LWIP_ASSERT("pbuf_remove_header failed", 0); goto bad; }