lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] RE: [bug #20147] getsockopt() with SO_ERROR option


From: Gollakota, Srinivas
Subject: [lwip-devel] RE: [bug #20147] getsockopt() with SO_ERROR option
Date: Mon, 11 Jun 2007 11:59:27 -0400

Yup, the fix works good with a small correction.

sock_set_errno(sock, err_to_errno(sock->conn->err)); /* PATCH note: 
sock->conn->err instead of conn->err*/

But the returned socket error is EIO (0x5) which seems to be inconsistent with 
the error values returned by the standard getsockopt() error values. I guess we 
have to return EINVAL if connection is closed.

http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?getsockopt+3

-Srinivas.

-----Original Message-----
From: Frédéric Bernon [mailto:address@hidden 
Sent: Monday, June 11, 2007 10:41 AM
To: Srinivas Gollakota; Frédéric Bernon; address@hidden
Subject: [bug #20147] getsockopt() with SO_ERROR option 



Follow-up Comment #1, bug #20147 (project lwip):

I think that conn->err is set to an error value (I suppose that err_tcp in 
api_msg.c is called, put a trace here to be sure).

But sock->err is not change until next send, recv, etc...

Perhaps you can test to patch sockets.c like this:

    case SO_ERROR:
      if (sock->err==0) {
        sock_set_errno(sock, err_to_errno(conn->err)); /*PATCH*/
      }
      *(int *)optval = sock->err;
      sock->err = 0;

Like this, you should keep the first error. Tell me if you got the trace in 
err_tcp, and if just patch is good for you...


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/




reply via email to

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