patch-2.2.6 linux/net/appletalk/aarp.c

Next file: linux/net/ipv6/tcp_ipv6.c
Previous file: linux/net/README
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.5/linux/net/appletalk/aarp.c linux/net/appletalk/aarp.c
@@ -128,6 +128,8 @@
 
 	skb_reserve(skb,dev->hard_header_len+aarp_dl->header_length);
 	eah		=	(struct elapaarp *)skb_put(skb,sizeof(struct elapaarp));
+	skb->protocol   =       htons(ETH_P_ATALK);
+	skb->nh.raw     =       skb->h.raw = (void *) eah;
 	skb->dev	=	dev;
 	
 	/*
@@ -186,6 +188,8 @@
 
 	skb_reserve(skb,dev->hard_header_len+aarp_dl->header_length);
 	eah		=	(struct elapaarp *)skb_put(skb,sizeof(struct elapaarp));	 
+	skb->protocol   =       htons(ETH_P_ATALK);
+	skb->nh.raw     =       skb->h.raw = (void *) eah;
 	skb->dev	=	dev;
 	
 	/*
@@ -246,7 +250,8 @@
 
 	skb_reserve(skb,dev->hard_header_len+aarp_dl->header_length);
 	eah		=	(struct elapaarp *)skb_put(skb,sizeof(struct elapaarp));
-	
+	skb->protocol   =       htons(ETH_P_ATALK);
+	skb->nh.raw     =       skb->h.raw = (void *) eah;
 	skb->dev	=	dev;
 	
 	/*
@@ -365,12 +370,10 @@
 		aarp_expire_timer(&unresolved[ct]);
 		aarp_expire_timer(&proxies[ct]);
 	}
-	del_timer(&aarp_timer);
-	if(unresolved_count==0)
-		aarp_timer.expires=jiffies+sysctl_aarp_expiry_time;
-	else
-		aarp_timer.expires=jiffies+sysctl_aarp_tick_time;
-	add_timer(&aarp_timer);
+
+	mod_timer(&aarp_timer, jiffies + 
+		  (unresolved_count ? sysctl_aarp_tick_time:
+		   sysctl_aarp_expiry_time));
 }
 
 /*
@@ -750,9 +753,7 @@
 
 	if(unresolved_count==1)
 	{
-		del_timer(&aarp_timer);
-		aarp_timer.expires=jiffies+sysctl_aarp_tick_time;
-		add_timer(&aarp_timer);
+		mod_timer(&aarp_timer, jiffies + sysctl_aarp_tick_time);
 	}
 
 	/*
@@ -939,9 +940,8 @@
 			aarp_resolved(&unresolved[hash],a,hash);
 			if(unresolved_count==0)
 			{
-				del_timer(&aarp_timer);
-				aarp_timer.expires=jiffies+sysctl_aarp_expiry_time;
-				add_timer(&aarp_timer);
+				mod_timer(&aarp_timer, jiffies +
+					  sysctl_aarp_expiry_time);
 			}
 			break;
 			

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)