9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: forsyth@plan9.cs.york.ac.uk forsyth@plan9.cs.york.ac.uk
Subject: seq_within
Date: Tue, 26 Sep 1995 18:09:57 -0400	[thread overview]
Message-ID: <19950926220957.35haFcNhFuo0-Zf4MTME9GnIu-U2JneyKb_zLdvRL4k@z> (raw)

does anyone else think the definition of seq_within in /sys/src/9/port/tcpinput.c
is wrong?  i think the test when low > high should be
		if(x >= low || x <= high)
not
		if(low >= x && x >= high)

i think as it stands it is checking the wrong interval.  consider its application in

	seq_within(seg.ack, tcb->snd.una+1, tcb->snd.nxt)


tcb->snd.una+1 > tcb->snd.nxt when the sequence numbers have wrapped round zero,
increasing from tcb->snd.una+1 past ~0 to 0 then on to tcb->snd.nxt.
in other words, the valid ack sequence numbers are those in
	[tcb->snd.una+1, ~0] ∪ [0, tcb->snd.nxt]
not (as seq_within currently has it) those in
	[tcb->snd.nxt, tcb->snd.una+1]







             reply	other threads:[~1995-09-26 22:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-09-26 22:09 forsyth [this message]
1995-09-27 15:51 seq_within Michael

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=19950926220957.35haFcNhFuo0-Zf4MTME9GnIu-U2JneyKb_zLdvRL4k@z \
    --to=forsyth@plan9.cs.york.ac.uk \
    /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).