[mod.protocols.appletalk] patch for rerouted packets and ktalk prompt

cck@CUCCA.COLUMBIA.EDU.UUCP (05/18/86)

Two things.  First, I found a better patch for routeip which follows.
Second, people should note that the newest version of the udp gateway
software doesn't allow you do a "find gateways" from prompt after the
gateway has started (e.g. you have to do a power cycle to catch it's
attention).  I assume this was done purposely.  If you need to allow
this (like we do), then patch the code in abreceive for packet type
'K' so it doesn't do any checking before calling K_KLAP, etc.

Diffs are based on the code as it came from the users group.

***************
*** 584,589
   * If a routing table existed within the gateway, it would determine
   * which interface pointer (ifp) and destination address (dst below)
   * are passed to ifp->if_output.
   */
  routeip(p)
  	register struct pbuf *p;

--- 593,602 -----
   * If a routing table existed within the gateway, it would determine
   * which interface pointer (ifp) and destination address (dst below)
   * are passed to ifp->if_output.
+  *
+  * Don't send a packet back out on the same interface it came in on.
+  * Should work for multiple ethernet interfaces.  Charlie C. Kim
+  *
   */
  routeip(p)
  	register struct pbuf *p;
***************
*** 624,629
  			dst = iproutedef;
  	}
  out:
  	(*ifp->if_output)(ifp, p, AF_IP, &dst);
  	return;
  drop:

--- 637,644 -----
  			dst = iproutedef;
  	}
  out:
+ 	if (p_if(p) == ifp)
+ 	  goto drop;
  	(*ifp->if_output)(ifp, p, AF_IP, &dst);
  	return;
  drop: