lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] How to send RST ?


From: yueyue papa
Subject: Re: [lwip-users] How to send RST ?
Date: Thu, 9 Dec 2010 11:03:39 +0800

I try this before.  It works. 

in tcp.c

err_t
tcp_close(struct tcp_pcb *pcb)
{
 ....
  case ESTABLISHED:
    if( rstClose & 0x1) // rstClose is a control flag.
    {
        err = tcp_send_ctrl(pcb, TCP_FIN);
        if (err == ERR_OK) {
          snmp_inc_tcpestabresets();
          pcb->state = FIN_WAIT_1;
        }
    }
    else
    {
        tcp_abort(pcb);
        err = ERR_OK;
        pcb = NULL;
    }
    break;
...
}


I ask the similar question before.  For the TCP/IP standard, the FIN is a good solution.  But the RST is a shotcut solution in certain environment.





On Wed, Dec 8, 2010 at 10:53 PM, Jeff Barber <address@hidden> wrote:
On Tue, Dec 7, 2010 at 10:23 PM, runjin <address@hidden> wrote:
> I found that closesocket sends a FIN packet,
> How to send RST ?

AFAIK, there is no way to send RST using the socket or netconn APIs.
But then this is not something that is normally available to
applications in other OSes like Linux or Windows either.  (If you're
using the raw API, you can call tcp_abort. However, that's not
something you can mix with the other APIs.)

What are you trying to accomplish by sending a RST?

Jeff

_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

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