Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcp: Fix TCP timestamps for big-endian systems #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/core/tcp_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -1993,17 +1993,17 @@ tcp_parseopt(struct tcp_pcb *pcb)
return;
}
/* TCP timestamp option with valid length */
tsval = tcp_get_next_optbyte();
tsval |= (tcp_get_next_optbyte() << 8);
tsval = (tcp_get_next_optbyte() << 24);
tsval |= (tcp_get_next_optbyte() << 16);
tsval |= (tcp_get_next_optbyte() << 24);
tsval |= (tcp_get_next_optbyte() << 8);
tsval |= tcp_get_next_optbyte();
if (flags & TCP_SYN) {
pcb->ts_recent = lwip_ntohl(tsval);
pcb->ts_recent = tsval;
/* Enable sending timestamps in every segment now that we know
the remote host supports it. */
tcp_set_flags(pcb, TF_TIMESTAMP);
} else if (TCP_SEQ_BETWEEN(pcb->ts_lastacksent, seqno, seqno + tcplen)) {
pcb->ts_recent = lwip_ntohl(tsval);
pcb->ts_recent = tsval;
}
/* Advance to next option (6 bytes already read) */
tcp_optidx += LWIP_TCP_OPT_LEN_TS - 6;
Expand Down