What is the definitive HUP protocol (for uucp)?

Chuck Privitera crp at ccivax.UUCP
Wed Feb 27 00:33:04 AEST 1985


I've seen many variations on the HUP protocol for UUCP.
e.g. :

System V[r2], 4.2BSD, 2.9BSD, others? :
	...
	case HUP:
		...
		if (msg[1] == 'Y') {
			WMESG(HUP, YES);
			turn off protocol
			return;
		}

In a bug report long ago (pre-4.2BSD):
	...
	if (msg[1] == 'Y') {
		WMESG(HUP, YES);
		/*
		 * If you look at this code carefully, you'll see that
		 * any site, either master or slave, which receives an
		 * HY always acknowledges with an HY.  Therefore, the
		 * actual protocol is:
		 *
		 * MASTER: send H ("I've got no work, how about you?")
		 * SLAVE: send HY ("I'm ready to hang up, how about you?")
		 * MASTER: send HY ("I'm ready to hang up, let's hang up.")
		 * SLAVE: send HY (this is the one that "isn't supposed
		 *	to be there") and turn off protocol.
		 *
		 * So the master should wait for the slave's HY before
		 * turning the protocol off on its side.
		 * What should REALLY happen is that only a MASTER
		 * should send out the HY, but changing that here would
		 * not solve the problem of talking to a side which
		 * hasn't fixed this.
		 * It looks like both people doing the turnoff is OK,
		 * in that it will result in an exchange of close
		 * messages and each machine will shut down when the
		 * it gets the CLOSE message from the other machine.
		 */
		if (role == MASTER)
			RMESG(HUP, msg, 1);

And finally, the implemenation suggested to be correct in the
above comment, i.e. :

		if (msg[1] == 'Y') {
			if (role == MASTER)
				WMESG(HUP, YES);
			turn off protocol;
			return;
		}

So which is correct? I'm getting too many:

uucp system (2/25-11:09-3289) BAD READ (expected 'H' got FAIL)

		Thanks in advance for any help on this,



More information about the Comp.unix.wizards mailing list