patch-2.0.37 linux/net/appletalk/ddp.c

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

diff -u --recursive --new-file v2.0.36/linux/net/appletalk/ddp.c linux/net/appletalk/ddp.c
@@ -408,6 +408,7 @@
 	 *	Scan the networks.
 	 */
 	 
+	atif->status |= ATIF_PROBE;
 	for(netct=0;netct<=netrange;netct++)
 	{
 		/*
@@ -435,8 +436,10 @@
 					if(atif->status&ATIF_PROBE_FAIL)
 						break;
 				}
-				if(!(atif->status&ATIF_PROBE_FAIL))
+				if(!(atif->status&ATIF_PROBE_FAIL)) {
+					atif->status &= ~ATIF_PROBE;
 					return 0;
+				}
 			}
 			atif->status&=~ATIF_PROBE_FAIL;
 		}
@@ -444,6 +447,7 @@
 		if(probe_net>ntohs(atif->nets.nr_lastnet))
 			probe_net=ntohs(atif->nets.nr_firstnet);
 	}
+	atif->status &= ~ATIF_PROBE;
 	return -EADDRINUSE;	/* Network is full... */
 }
 
@@ -509,7 +513,7 @@
 	struct atalk_iface *iface;
 	for(iface=atalk_iface_list;iface!=NULL;iface=iface->next)
 	{
-		if((node==ATADDR_BCAST || iface->address.s_node==node) 
+		if((node==ATADDR_BCAST || node==ATADDR_ANYNODE || iface->address.s_node==node) 
 			&& iface->address.s_net==net && !(iface->status&ATIF_PROBE))
 			return iface;
 	}
@@ -1544,7 +1548,10 @@
 	/* Which socket - atalk_search_socket() looks for a *full match*
 	   of the <net,node,port> tuple */
 	tosat.sat_addr.s_net = ddp->deh_dnet;
-	tosat.sat_addr.s_node = ddp->deh_dnode;
+	if (ddp->deh_dnode == ATADDR_ANYNODE)
+		tosat.sat_addr.s_node = atif->address.s_node;
+	else
+		tosat.sat_addr.s_node = ddp->deh_dnode;
 	tosat.sat_port = ddp->deh_dport;
 
 	sock=atalk_search_socket( &tosat, atif );

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