Patch #6823: tcp_in.c - small optimization

This commit is contained in:
goldsimon 2009-05-06 17:30:18 +00:00
parent 518b18dad0
commit ac9e758f41

View File

@ -169,8 +169,8 @@ tcp_input(struct pbuf *p, struct netif *inp)
ackno = tcphdr->ackno = ntohl(tcphdr->ackno); ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
tcphdr->wnd = ntohs(tcphdr->wnd); tcphdr->wnd = ntohs(tcphdr->wnd);
flags = TCPH_FLAGS(tcphdr) & TCP_FLAGS; flags = TCPH_FLAGS(tcphdr);
tcplen = p->tot_len + ((flags & TCP_FIN || flags & TCP_SYN)? 1: 0); tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
/* Demultiplex an incoming segment. First, we check if it is destined /* Demultiplex an incoming segment. First, we check if it is destined
for an active connection. */ for an active connection. */