[bug #9455] The sockets API does not correctly inform a process that a RST has been received

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #9455] The sockets API does not correctly inform a process that a RST has been received

Ashley Duncan

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

It's going to be tricky to fix this in a portable way as signals aren't
terribly portable.

We could certainly do the "returns EPIPE" part though.

Any thoughts?

    _______________________________________________________

Reply to this item at:

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

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



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #9455] The sockets API does not correctly inform a process that a RST has been received

Ashley Duncan

Follow-up Comment #2, bug #9455 (project lwip):

Is something done on that? Actually, if we got a ERR_RST, even with only
send, sockets api will returns ECONNRESET:

//from sockets.c
ECONNRESET,    /* ERR_RST     -4      Connection reset.        */

Is EPIPE is really a better error code?



    _______________________________________________________

Reply to this item at:

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

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



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #9455] The sockets API does not correctly inform a process that a RST has been received

Ashley Duncan

Follow-up Comment #3, bug #9455 (project lwip):

(I'm referring to the explanation given in
http://www.opengroup.org/onlinepubs/000095399/functions/send.html)

Since we can't close a connection for writing only (can we?), I think both
error codes (ECONNRESET and EPIPE) are correct. So it's up to us to decide
which one we want to use. Since ERR_RST is only used with tcp, defining
ERR_RST to EPIPE should do the trick. (Or is EPIPE also returned to UDP
sockets when an icmp-packet 'dest unreachable' was received for that udp
port? I don't think we support that).

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #9455] The sockets API does not correctly inform a process that a RST has been received

Ashley Duncan

Follow-up Comment #4, bug #9455 (project lwip):

Frederic's point was that sockets.c already returns ECONNRESET for ERR_RST.
As far as I know, this is what all other systems do in the same situation,
and so is a better error code than EPIPE.

As far as I can tell, send/write use netconn_write, which will return
conn->err if it isn't ERR_OK. So ERR_RST should be returned, causing
ECONNRESET to in turn be returned. I admit I haven't tried experimenting.

BTW, I believe EPIPE is when the local end has been closed.


    _______________________________________________________

Reply to this item at:

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

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



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #9455] The sockets API does not correctly inform a process that a RST has been received

Ashley Duncan

Follow-up Comment #5, bug #9455 (project lwip):

>BTW, I believe EPIPE is when the local end has been closed.

As far as I know, that's correct. So this bug could be closed?

Note that at the time of the bug report, sockets.c already returned
ECONNRESET, so maybe the bug was invalid at that time already?

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #9455] The sockets API does not correctly inform a process that a RST has been received

Ashley Duncan

Follow-up Comment #6, bug #9455 (project lwip):

Ok for me to close it as invalid...

    _______________________________________________________

Reply to this item at:

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

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



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #9455] The sockets API does not correctly inform a process that a RST has been received

Ashley Duncan

Update of bug #9455 (project lwip):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #7:

OK.

To summarise, we think the error code returned is currently correct, and
we're not going to bother with sending signals.



    _______________________________________________________

Reply to this item at:

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

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



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel