Index: include/linux/ipx.h
--- linux.org/include/linux/ipx.h	Mon Feb  6 19:25:22 1995
+++ linux/include/linux/ipx.h	Fri Mar 22 00:58:02 1996
@@ -74,5 +74,6 @@
 #define SIOCAIPXITFCRT		(SIOCPROTOPRIVATE)
 #define SIOCAIPXPRISLT		(SIOCPROTOPRIVATE+1)
 #define SIOCIPXCFGDATA		(SIOCPROTOPRIVATE+2)
+#define SIOCIPXNCPCONN		(SIOCPROTOPRIVATE+3)
 #endif
 
Index: net/inet/ipx.c
--- linux.org/net/inet/ipx.c	Tue Apr 18 21:13:26 1995
+++ linux/net/inet/ipx.c	Fri Mar 22 01:25:25 1996
@@ -341,6 +341,20 @@
 	struct sk_buff	*skb1 = NULL, *skb2 = NULL;
 	int		ipx_offset;
 
+        if (intrfc == ipx_primary_net
+          && ntohs(ipx->ipx_dest.sock) == 0x451
+          &&  *((char*)(ipx+1))   == 0x22
+          &&  *((char*)(ipx+1)+1) == 0x22) {
+          int connection = (int) *((char*)(ipx+1)+3);
+           /* 255 connections are enough ;) */
+           if (connection) {
+             for (sock1=intrfc->if_sklist;
+                (sock1 != NULL) &&
+                (sock1->ipx_ncp_conn != connection);
+                sock1=sock1->next);;
+           }
+        }
+        if (sock1 == NULL)
 	sock1 = ipxitf_find_socket(intrfc, ipx->ipx_dest.sock);
 
 	/*
@@ -859,6 +873,7 @@
 			ipxif=ipxitf_find_using_phys(dev, ipx_map_frame_type(sipx->sipx_type));
 			if(ipxif==NULL)
 				return -EADDRNOTAVAIL;
+                        sipx->sipx_family=AF_IPX;
 			sipx->sipx_network=ipxif->if_netnum;
 			memcpy(sipx->sipx_node, ipxif->if_node, sizeof(sipx->sipx_node));
 			memcpy_tofs(arg,&ifr,sizeof(ifr));
@@ -909,7 +924,8 @@
 			return -EAGAIN;
 		rt->ir_next=ipx_routes;
 		ipx_routes=rt;
-	}
+	} else if (intrfc  == ipx_internal_net)
+          return(-EEXIST); /* fix for mars_nwe: 11-Jan-96 */
 
 	rt->ir_net = network;
 	rt->ir_intrfc = intrfc;
@@ -983,6 +999,7 @@
 	int size;
 	int ipx_offset;
 	ipx_route *rt = NULL;
+        int  snr;
 
 	/* Find the appropriate interface on which to send packet */
 	if ((usipx->sipx_network == 0L) && (ipx_primary_net != NULL)) {
@@ -1017,9 +1034,14 @@
 	ipx->ipx_tctrl=0;
 	ipx->ipx_type=usipx->sipx_type;
 	skb->h.raw = (unsigned char *)ipx;
-
+        if ((snr=ntohs(sk->ipx_port)) == 0x453 || snr == 0x452) {
+          /* RIP/SAP speicial handling for mars_nwe: 11-Jan-96 */
+	  ipx->ipx_source.net = intrfc->if_netnum;
+	  memcpy(ipx->ipx_source.node, intrfc->if_node, IPX_NODE_LEN);
+        } else {
 	ipx->ipx_source.net = sk->ipx_intrfc->if_netnum;
 	memcpy(ipx->ipx_source.node, sk->ipx_intrfc->if_node, IPX_NODE_LEN);
+	}
 	ipx->ipx_source.sock = sk->ipx_port;
 	ipx->ipx_dest.net=usipx->sipx_network;
 	memcpy(ipx->ipx_dest.node,usipx->sipx_node,IPX_NODE_LEN);
@@ -1335,6 +1357,7 @@
 		return err;
 	put_fs_long(sizeof(int),(unsigned long *)optlen);
 	err=verify_area(VERIFY_WRITE,optval,sizeof(int));
+        if (err) return err;
 	put_fs_long(val,(unsigned long *)optval);
 	return(0);
 }
@@ -1397,6 +1420,8 @@
 	sk->debug=0;
 	sk->ipx_intrfc = NULL;
 	memset(&sk->ipx_dest_addr,'\0',sizeof(sk->ipx_dest_addr));
+        sk->ipx_ncp_conn = 0;     /* no ncp socket yet */
+
 	sk->ipx_port = 0;
 	sk->mtu=IPX_MTU;
 	
@@ -1835,6 +1860,16 @@
 			if(err) return err;
 			return(ipxcfg_get_config_data((void *)arg));
 		}
+               case SIOCIPXNCPCONN:
+                {
+                   if (!suser()) return(-EPERM);
+                   err = verify_area(VERIFY_READ, (void *)arg,
+                                 sizeof(unsigned short));
+                   if (err) return err;
+                   sk->ipx_ncp_conn = get_fs_word(arg);
+                   return 0;
+                 }
+
 		case SIOCGSTAMP:
 			if (sk)
 			{
Index: net/inet/sock.h
Prereq: 	1.0.4	
--- linux.org/net/inet/sock.h	Fri Mar 22 01:11:28 1996
+++ linux/net/inet/sock.h	Fri Mar 22 01:12:26 1996
@@ -146,6 +146,7 @@
   ipx_interface			*ipx_intrfc;
   unsigned short		ipx_port;
   unsigned short		ipx_type;
+  unsigned short          	ipx_ncp_conn;
 #endif
 #ifdef CONFIG_AX25
 /* Really we want to add a per protocol private area */
