buglwIP - A Lightweight TCP/IP stack - Bugs: bug #2114, tcp pcb never set to LISTEN state.

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #2114: tcp pcb never set to LISTEN state.

Submitted by:  David Haas <davidhaas>
Submitted on:  Thu 02 Jan 2003 07:23:43 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Leon Woestenberg <likewise>
Open/Closed: ClosedPlanned Release: None
lwIP version: None

Fri 14 Nov 2003 09:50:18 AM UTC, comment #4:

This seems to have been fixed in DEVEL at some point:

tcp_listen(struct tcp_pcb *pcb)
{
struct tcp_pcb_listen *lpcb;

/* already listening? */
if (pcb->state == LISTEN) {
return pcb;
}
lpcb = memp_malloc(MEMP_TCP_PCB_LISTEN);
if (lpcb == NULL) {
return NULL;
}
lpcb->callback_arg = pcb->callback_arg;
lpcb->local_port = pcb->local_port;
lpcb->state = LISTEN;

Leon Woestenberg <likewise>
Project MemberIn charge of this item.
Fri 17 Jan 2003 02:29:42 PM UTC, comment #3:

patch applied but bug stays since this issue needs more thought.Is the ~120 bytes/listen saved worth the extra trouble?Listening sockets shouldn't be that many especially on
memorycally challenged targets.Not trying to pave the way for
hwIP but IMHO it's better to keep the code simpler in this case and have one type of pcb only.Anyway it's not a really important matter.

Jani Monoses <jani>
Project Member
Mon 06 Jan 2003 02:59:26 PM UTC, comment #2:

See patch 922 for a fix.

David Haas <davidhaas>
Project Member
Mon 06 Jan 2003 01:46:26 PM UTC, comment #1:

Looks like nobody ever sets pcb state to LISTEN so any check for pcb->state == LISTEN is useless.The problem is that for
listening connections there is a listeing pcb struct not a normal pcb struct.And they are not compatible as lpcb does not even have a state field....the only way of distinguishing is by finding whether the pcb is on the active or the listening pcb's list.I'll look at this closer.

Jani Monoses <jani>
Project Member
Thu 02 Jan 2003 07:23:43 PM UTC, original submission:

tcp_listen() never sets the new lpcb state to LISTEN. This means that when tcp_close() is called on a listening pcb, it cannot clean up properly

David Haas <davidhaas>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 14 Nov 2003 09:50:18 AM UTClikewiseStatusNone=>(Error - Not Found)
  Assigned toNone=>NA
  Open/ClosedOpen=>(Error - Not Found)
Wed 07 May 2003 08:50:15 PM UTClikewiseItem GroupNone=>(Error - Not Found)
Wed 07 May 2003 08:50:14 PM UTClikewiseCategoryNone=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1