lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: [lwip] TCP-Connect and Bind


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] TCP-Connect and Bind
Date: Wed, 08 Jan 2003 23:32:27 -0000

Hi!

On Tuesday 30 April 2002 16.07, Holger Fried wrote:
> I have a little problem with the raw-api, of lwip. I want to do a
> tcp-connect on certain local port, but tcp_connect overwrites the
> pcb->localport with the result of tcp_new_port. I examined the api_msg.c
> and there the bind call comes after the connect call. This is a solution
> for my problem, but where can I know, that in a multithreaded environment
> the bind call comes before the connect is really sent?

This is a bug in lwIP - tcp_connect() should check if local_port == 0 before 
is calls tcp_new_port(). Like this:

  if(pcb->local_port == 0) {
    pcb->local_port = tcp_new_port();
  }

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam

[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]