bug #27315: zero window probe and FIN: only send pure FIN if the enqueued FIN segment doesn't contain any other data

This commit is contained in:
goldsimon 2009-10-21 15:15:34 +00:00
parent 67411c4299
commit f1b82e0e9a

View File

@ -948,7 +948,7 @@ tcp_zero_window_probe(struct tcp_pcb *pcb)
if(seg == NULL)
return;
is_fin = (TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0;
is_fin = ((TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0) && (seg->len == 0);
len = is_fin ? TCP_HLEN : TCP_HLEN + 1;
p = pbuf_alloc(PBUF_IP, len, PBUF_RAM);