[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #30565] tcp_connect() check bound list
From: |
Oleg Tyshev |
Subject: |
[lwip-devel] [bug #30565] tcp_connect() check bound list |
Date: |
Tue, 27 Jul 2010 14:01:39 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 GTB7.0 |
URL:
<http://savannah.nongnu.org/bugs/?30565>
Summary: tcp_connect() check bound list
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: olegreen
Submitted on: Di 27 Jul 2010 14:01:38 GMT
Category: TCP
Severity: 3 - Normal
Item Group: Faulty Behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: CVS Head
_______________________________________________________
Details:
In this code fragment will be checked
bound pcbs list,
active pcbs list and
time-wait pcbs list
tcp_connect(...)
{
...
/* Don't check listen PCBs, check bound-, active- and TIME-WAIT PCBs. */
for (i = 1; i < NUM_TCP_PCB_LISTS; i++) {
for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
if ((cpcb->local_port == pcb->local_port) &&
(cpcb->remote_port == port) &&
ip_addr_cmp(&cpcb->local_ip, &pcb->local_ip) &&
ip_addr_cmp(&cpcb->remote_ip, ipaddr)) {
/* linux returns EISCONN here, but ERR_USE should be OK for us */
return ERR_USE;
}
}
But for bound pcbs list compare of the remote ip and port will be allways
false.
So, instead of
for (i = 1; i < NUM_TCP_PCB_LISTS; i++) {
will be better write
for (i = 2; i < NUM_TCP_PCB_LISTS; i++) {
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?30565>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #30565] tcp_connect() check bound list,
Oleg Tyshev <=