From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Fri, 15 Feb 2008 15:29:43 -0200 From: "Iruata Souza" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] /net panic In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <140e7ec30802150120y1b0e4b33lf76787aaee84edd2@mail.gmail.com> Topicbox-Message-UUID: 553665c4-ead3-11e9-9d60-3106f5b1d025 On Fri, Feb 15, 2008 at 2:23 PM, erik quanstrom wrote: > >i'm not sure this is a perfect solution. i just don't have enough >of the plan 9 ip stack loaded into cache to be sure nothing's >been forgotten. but give this patch a whirl. basically, i think >the problem is that inittcpctl() was stepping on timers that might >have been active. these timers need to be shutdown. unfortunately, >tcpclose() and localclose() are too agressive. cleanupconnection() >is a chopped-down version of localclose. > >- erik > > >/n/sources/plan9//sys/src/9/ip/tcp.c:782,787 - tcp.c:782,813 > return mtu; > } > >+ static void >+ cleanupconnection(Conv *s) >+ { >+ Tcpctl *tcb; >+ Reseq *rp,*rp1; >+ Tcppriv *tpriv; >+ >+ tpriv = s->p->priv; >+ tcb = (Tcpctl*)s->ptcl; >+ >+ iphtrem(&tpriv->ht, s); >+ >+ tcphalt(tpriv, &tcb->timer); >+ tcphalt(tpriv, &tcb->rtt_timer); >+ tcphalt(tpriv, &tcb->acktimer); >+ tcphalt(tpriv, &tcb->katimer); >+ >+ /* Flush reassembly queue; nothing more can arrive */ >+ for(rp = tcb->reseq; rp != nil; rp = rp1) { >+ rp1 = rp->next; >+ freeblist(rp->bp); >+ free(rp); >+ } >+ tcb->reseq = nil; >+ } >+ > void > inittcpctl(Conv *s, int mode) > { >/n/sources/plan9//sys/src/9/ip/tcp.c:792,798 - tcp.c:818,827 > > tcb = (Tcpctl*)s->ptcl; > >- memset(tcb, 0, sizeof(Tcpctl)); >+ if(tcb->timer.arg) // c->state != Idle? >+ cleanupconnection(s); >+ else >+ memset(tcb, 0, sizeof(Tcpctl)); > > tcb->ssthresh = 65535; > tcb->srtt = tcp_irtt< works for me. I don't know the internal workings of the plan 9 ip stack so I take the risk of being silly: could be that the bug is not tcp only? iru