9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Iruata Souza" <iru.muzgo@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] /net panic
Date: Fri, 15 Feb 2008 15:29:43 -0200	[thread overview]
Message-ID: <d1c554290802150929w510ec9ealca115f9ab9efa708@mail.gmail.com> (raw)
In-Reply-To: <ee773d2313208a0317a98c67313d0841@quanstro.net>

On Fri, Feb 15, 2008 at 2:23 PM, erik quanstrom <quanstro@quanstro.net> 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<<LOGAGAIN;
>

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


  reply	other threads:[~2008-02-15 17:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15  9:20 sqweek
2008-02-15 15:19 ` Iruata Souza
2008-02-15 16:10   ` Iruata Souza
2008-02-15 16:23 ` erik quanstrom
2008-02-15 17:29   ` Iruata Souza [this message]
2008-02-15 18:34     ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d1c554290802150929w510ec9ealca115f9ab9efa708@mail.gmail.com \
    --to=iru.muzgo@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).