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: leon . woestenberg
Subject: Re: [lwip-users] netconn_bind crashes when ip_addr is NULL
Date: Tue, 15 Apr 2003 11:19:50 +0200


Hello,

Just like IP_ADDR_BROADCAST is a pointer to { 0xffffffffUL } (255.255.255.255),
IP_ADDR_ANY now is a pointer to { 0UL } (0.0.0.0).

I would suggest replacing NULL by IP_ADDR_ANY (and changing the API as
such).

I have restored the behaviour where ip_addr_set() handles NULL as
IP_ADDR_ANY in current CVS.

The exact behaviour should be that the binding is host-wide (i.e. not limited
to exactly one interface).

Regards,

Leon.

 



Sergio PérezAlcañiz <address@hidden>
Sent by: address@hidden

15-04-2003 10:44
Please respond to Mailing list for lwIP users

       
        To:        address@hidden
        cc:        
        Subject:        [lwip-users] netconn_bind crashes when ip_addr is NULL



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]