All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John Hughes" <John@Calva.COM>
To: 'John Hughes' <John@Calva.COM>, 'Ian Cass' <ian.cass@mblox.com>
Cc: linux-x25@vger.kernel.org
Subject: RE : XOT
Date: Tue, 8 Oct 2002 17:04:38 +0200	[thread overview]
Message-ID: <008001c26edc$06596ea0$f70127d5@britannic> (raw)
In-Reply-To: 

I said:

> I'm having a little problem making Linux xotd work with my
> home grown implementation, but I think I've tracked it down
> to a difference of opinion about when the TCP call should be
> cleared.

The way xotd works is that it clears the TCP call if it
recieves an X.25 CLEAR CONFIRMATION:

	void *tap_writer(void *arg)
	{
	...
	    while (1) {

	        nread = readn(sockfd,(unsigned char*)&header,
	                      sizeof(struct xot_header));
	        if (nread != sizeof(struct xot_header)) {
	...
	             break;  /* abort */
	        }
	...

	    }

	    if (isVerbose)
	        printd("TCP connection closed (tap writer), 
	               lci=%d.",curr_lci);

	    hash_remove(&hash_table, sockfd, lci);

	    close(sockfd);      /* TODO: add to a spare list, 
	                           for use by tap_reader */

This seems reasonable.  *BUT* if xotd SENDS a CLEAR CONFIRMATION,
in the other direction it does not clear the call, it keeps it
open and will re-use it for new connections.  (It used to clear
the call, but as of version 0.04 this is commented out).

Now imagine what happens when two of these xotd's are talking
together - 

xotd#1                            xotd#2         
send clear conf >----\
                      \----------> Get clear conf
                                           |
                        /--------< Clear TCP call
Send new call >----\   /
                    \ /
                     X
                    / 
Eurgh          <---/

Whoops! the new call has been sent on a socket that has been
closed by the other side.
                    



             reply	other threads:[~2002-10-08 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08 15:04 John Hughes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-08 10:16 XOT Ian Cass
2002-10-08 10:52 ` RE : XOT John Hughes
2002-10-05 17:41 XOT Ian Cass
2002-10-07  7:21 ` RE : XOT John Hughes
2002-10-08  1:53   ` Arnaldo Carvalho de Melo

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='008001c26edc$06596ea0$f70127d5@britannic' \
    --to=john@calva.com \
    --cc=ian.cass@mblox.com \
    --cc=linux-x25@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.