lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] netconn_bind crashes when ip_addr is NULL


From: Jani Monoses
Subject: Re: [lwip-users] netconn_bind crashes when ip_addr is NULL
Date: Tue, 15 Apr 2003 12:00:05 +0300

this is because recently set_ip_addr was changed to not check for 
the passed in src addr so it tries to dereference NULL.
I don't know whether it was done so this is handled by the upper layers
instead of IP or not.
At some point if ip_addr is NULL it should be replaced with an
ip_addr_any = 0.0.0.0 

BTW I noticed this the other day because unixsim crashes too.

Jani.


> Hello, I've just ported the latest CVS version of lwIP to RT-Linux,
> and one example I wrote for the before porting (0.5.3) crashes now
> when trying to bind to a localhost ip_addr (when using the sequential
> API). The line marked with---> crashes then ipaddr is NULL. In the
> previous version (0.5.3) binding to NULL meant that the udpserver got
> binded to the default local ip_addr. Maybe the meaning of this has
> changed in the latest version???
> 
>   static struct netconn *conn;
>   static struct netbuf *buf;
>   char buffer[4096];
>   struct ip_addr ipaddr;
> 
>   conn = netconn_new(NETCONN_UDP);
> 
>   IP4_ADDR(&ipaddr, 158,42,53,14);
> 
> ----->   netconn_bind(conn, &ipaddr, 8);  //  netconn_bind(conn, NULL,
> 8);
> 
>   while(1) {
>     buf = netconn_recv(conn);
>     netbuf_copy(buf, buffer, sizeof(buffer));
>     printf("----------- UDP echo server got: %s -------------\n",
>     buffer); netbuf_delete(buf);
>   }
> 
> 
> 
> Regards.
> Sergio
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/lwip-users




reply via email to

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