Problem with 4.2BSD talk (better solution)
Ron Wessels
ron at uthub.UUCP
Mon Nov 19 04:18:27 AEST 1984
>> From: crp at ccivax.UUCP (Chuck Privitera)
>> Subject: Problem with 4.2BSD talk
>> Message-ID: <220 at ccivax.UUCP>
>> Posted: Tue Nov 13 15:33:05 1984
>>
>> . . .
>> When using the software loopback network interface as your primary
>> network, talk can't communicate with foreign hosts.
>> . . .
>> Talk isn't really hung. It is actually waiting for a response from
>> the foreign host. Well, the foreign host will never be able to
>> respond. The problem is that talk sends a "control" packet to the
>> remote talk daemon which contains (among other things) the address
>> of the remote talk's socket (who is on the loopback network). So,
>> the foreign host receives the control packets correctly, but when
>> it tries to respond (by writing to the address supplied in the
>> packet it just received), the response gets swallowed by the
>> loopback driver on the foreign host!!
The analysis of this problem provided by Chuck is right on the
money. The fix, however, isn't all that great.
Firstly, let me explain that, by your "primary network", we mean
the network referenced in the (textually) first line in /etc/hosts
that contains `hostname`.
If you have any network that is capable of talking to itself [ie.
you make that network your primary network and "rlogin `hostname`"
works], then you should not have the looopback network as your primary
network. Talk(1) is just one example of the general philosophy that
a user program should be able to determine a valid network address for
its machine using a "gethostbyname (gethostname ())" construct [ignore
incorrect syntax]. Your primary network should be one of these real
networks [if you have more than one]. The choice of which one is a
separate issue ... any one will work, assuming your routes are set up
correctly [see route(8) and routed(8)].
Assuming you just have point-to-point network(s) connected to
your machine [or some other network that can't talk to itself], you
can still make one of these your primary network, but you have to
adjust the network routes somewhat. If you are not running the
/etc/routed routing daemon [which I highly recommend you don't run
... it's a useless CPU pig that we couldn't get working with point-
to-point networks], then simply add the line
/etc/route add `hostname` localhost
into your /etc/rc.local file. If you are running /etc/routed [and
I can't persuade you to trash it and go to manual "/etc/route add"
lines in /etc/rc.local ... how often does your network topology
change anyway?], then creating an /etc/gateways file with the line
host `hostname` gateway localhost metric 0 passive
should work. Of course, you should expand `hostname` to your real
host name. This has the effect of routing all traffic destined for
the local host [`hostname`] to go through the loopback interface.
For those of you who braved through all that junk, the net
result [pun unintended] is that talk(1) will now send a valid
network address to the remote host. Thus, everyone is happy.
And you don't need that "oops, it's the loopback net ... let's
look for another entry" stuff in /etc/talkd.
--
Ron Wessels Computer Systems Research Institute University of Toronto
{ decvax , floyd , ihnp4 , linus , utzoo , uw-beaver }!utcsrgv!uthub!ron
More information about the Comp.bugs.2bsd
mailing list