work on -Wconversion...

This commit is contained in:
goldsimon 2017-07-03 20:14:39 +02:00
parent 94beb4eddf
commit d262132b92
2 changed files with 5 additions and 5 deletions

View File

@ -154,7 +154,7 @@ tcp_input(struct pbuf *p, struct netif *inp)
#endif /* CHECKSUM_CHECK_TCP */
/* sanity-check header length */
hdrlen_bytes = TCPH_HDRLEN(tcphdr) * 4;
hdrlen_bytes = TCPH_HDRLEN_BYTES(tcphdr);
if ((hdrlen_bytes < TCP_HLEN) || (hdrlen_bytes > p->tot_len)) {
LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: invalid header length (%"U16_F")\n", (u16_t)hdrlen_bytes));
TCP_STATS_INC(tcp.lenerr);
@ -163,12 +163,12 @@ tcp_input(struct pbuf *p, struct netif *inp)
/* Move the payload pointer in the pbuf so that it points to the
TCP data instead of the TCP header. */
tcphdr_optlen = hdrlen_bytes - TCP_HLEN;
tcphdr_optlen = (u16_t)(hdrlen_bytes - TCP_HLEN);
tcphdr_opt2 = NULL;
if (p->len >= hdrlen_bytes) {
/* all options are in the first pbuf */
tcphdr_opt1len = tcphdr_optlen;
pbuf_header(p, -(s16_t)hdrlen_bytes); /* cannot fail */
pbuf_header(p, (s16_t)-(s16_t)hdrlen_bytes); /* cannot fail */
} else {
u16_t opt2len;
/* TCP header fits into first pbuf, options don't - data is in the next pbuf */

View File

@ -1311,12 +1311,12 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb, struct netif *netif
#endif /* TCP_CHECKSUM_ON_COPY_SANITY_CHECK */
if ((seg->flags & TF_SEG_DATA_CHECKSUMMED) == 0) {
LWIP_ASSERT("data included but not checksummed",
seg->p->tot_len == (TCPH_HDRLEN(seg->tcphdr) * 4));
seg->p->tot_len == TCPH_HDRLEN_BYTES(seg->tcphdr);
}
/* rebuild TCP header checksum (TCP header changes for retransmissions!) */
acc = ip_chksum_pseudo_partial(seg->p, IP_PROTO_TCP,
seg->p->tot_len, TCPH_HDRLEN(seg->tcphdr) * 4, &pcb->local_ip, &pcb->remote_ip);
seg->p->tot_len, TCPH_HDRLEN_BYTES(seg->tcphdr), &pcb->local_ip, &pcb->remote_ip);
/* add payload checksum */
if (seg->chksum_swapped) {
seg->chksum = SWAP_BYTES_IN_WORD(seg->chksum);