lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #22435] lwip_recvfrom with TCP break;


From: Cui hengbin
Subject: [lwip-devel] [bug #22435] lwip_recvfrom with TCP break;
Date: Thu, 28 Feb 2008 08:16:44 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.8.1.12) Gecko/20080208 Fedora/2.0.0.12-1.fc8 Firefox/2.0.0.12

URL:
  <http://savannah.nongnu.org/bugs/?22435>

                 Summary: lwip_recvfrom with TCP break;
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: phant
            Submitted on: Thursday 02/28/08 at 08:16
                Category: sockets
                Severity: 3 - Normal
              Item Group: Crash Error
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 

    _______________________________________________________

Details:


Hi All:
   when i use lwip_recvfrom() with from!=NULL,and fromlen!=NULL,it  will
break .

int lwip_recv_from(...)
{
...
if (from && fromlen) {
    struct sockaddr_in sin;

    addr = netbuf_fromaddr(buf);
    port = netbuf_fromport(buf);

    memset(&sin, 0, sizeof(sin));
    sin.sin_len = sizeof(sin);
    sin.sin_family = AF_INET;
    sin.sin_port = htons(port);
    sin.sin_addr.s_addr = addr->addr;----> break in this line

...
}

i find in netconn_recv has follow codes:

#if LWIP_TCP
...
  buf->p = p;
  buf->ptr = p;
  buf->port = 0;
  buf->addr = NULL;             /* this line may be wrong*/
...
#endif


so should be as follow:

  buf->p = p;
  buf->ptr = p;
  buf-port = conn->pcb.tcp->remote_port;
  buf->addr = (struct ip_addr*)&(conn->pcb.tcp->remote_ip);

FYI




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22435>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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