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: Simon Goldschmidt
Subject: Re: [lwip-users] How to send RST ?
Date: Fri, 10 Dec 2010 05:24:56 +0100

I do have to point out that this is *not* a good solution as tcp_abort() may 
not be called in all places where tcp_close() may be called as it directly 
deallocates the pcb and changes the tcp pcb lists. It might work for you, but 
it's just not designed to be called like that.

Simon


yueyue papa <address@hidden> wrote:
> An: Mailing list for lwIP users <address@hidden>
> Betreff: Re: [lwip-users] How to send RST ?

> 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
> >

-- 
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome



reply via email to

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