patch-2.2.0-pre1 linux/net/appletalk/ddp.c

Next file: linux/net/bridge/br.c
Previous file: linux/net/appletalk/aarp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.132/linux/net/appletalk/ddp.c linux/net/appletalk/ddp.c
@@ -31,12 +31,19 @@
  *						AppleTalk drivers, cleaned it.
  *		Rob Newberry		:	Added proxy AARP and AARP proc fs, 
  *						moved probing to AARP module.
+ *              Adrian Sun/ 
+ *              Michael Zuelsdorff      :       fix for net.0 packets. don't 
+ *                                              allow illegal ether/tokentalk
+ *                                              port assignment. we lose a 
+ *                                              valid localtalk port as a 
+ *                                              result.
+ *              
  *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
  *		as published by the Free Software Foundation; either version
  *		2 of the License, or (at your option) any later version.
- *
+ * 
  */
 
 #include <linux/config.h>
@@ -141,7 +148,7 @@
 			continue;
 	   	}
 
-	    	if(to->sat_addr.s_net == 0
+	    	if(to->sat_addr.s_net == ATADDR_ANYNET
 			&& to->sat_addr.s_node == ATADDR_BCAST
 			&& s->protinfo.af_at.src_net == atif->address.s_net)
 		{
@@ -156,7 +163,14 @@
 			break;
 	   	}
 
-	    	/* XXXX.0 */
+	    	/* XXXX.0 -- we got a request for this router. make sure
+		 * that the node is appropriately set. */
+		if (to->sat_addr.s_node == ATADDR_ANYNODE &&
+		    to->sat_addr.s_net != ATADDR_ANYNET &&
+		    atif->address.s_node == s->protinfo.af_at.src_node) {
+			to->sat_addr.s_node = atif->address.s_node;
+			break; 
+		}
 	}
 
 	return (s);
@@ -502,6 +516,12 @@
 			&& iface->address.s_net==net 
 			&& !(iface->status & ATIF_PROBE))
 			return (iface);
+
+		/* XXXX.0 -- net.0 returns the iface associated with net */
+		if ((node==ATADDR_ANYNODE) && (net != ATADDR_ANYNET) &&
+		    (ntohs(iface->nets.nr_firstnet) <= ntohs(net)) &&
+		    (ntohs(net) <= ntohs(iface->nets.nr_lastnet)))
+		        return (iface);
 	}
 
 	return (NULL);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov