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

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

diff -u --recursive --new-file v2.1.42/linux/net/appletalk/aarp.c linux/net/appletalk/aarp.c
@@ -49,6 +49,12 @@
 #include <linux/atalk.h>
 #include <linux/init.h>
 
+ 
+int sysctl_aarp_expiry_time = AARP_EXPIRY_TIME;
+int sysctl_aarp_tick_time = AARP_TICK_TIME;
+int sysctl_aarp_retransmit_limit = AARP_RETRANSMIT_LIMIT;
+int sysctl_aarp_resolve_time = AARP_RESOLVE_TIME;
+
 /*
  *	Lists of aarp entries
  */
@@ -309,7 +315,7 @@
 	{
 		/* Expired - if this will be the 11th transmit, we delete
 		   instead */
-		if((*n)->xmit_count>=AARP_RETRANSMIT_LIMIT)
+		if((*n)->xmit_count>=sysctl_aarp_retransmit_limit)
 		{
 			t= *n;
 			*n=(*n)->next;
@@ -359,9 +365,9 @@
 	}
 	del_timer(&aarp_timer);
 	if(unresolved_count==0)
-		aarp_timer.expires=jiffies+AARP_EXPIRY_TIME;
+		aarp_timer.expires=jiffies+sysctl_aarp_expiry_time;
 	else
-		aarp_timer.expires=jiffies+AARP_TICK_TIME;
+		aarp_timer.expires=jiffies+sysctl_aarp_tick_time;
 	add_timer(&aarp_timer);
 }
 
@@ -475,6 +481,21 @@
 		dev_queue_xmit(skb);
 		return 1;
 	}	
+
+	/*
+	 *	On a PPP link we neither compress nor aarp.
+	 */
+	if(dev->type==ARPHRD_PPP)
+	{
+		skb->protocol = htons(ETH_P_PPPTALK);
+		if(skb->sk==NULL)
+			skb->priority = SOPRI_NORMAL;
+		else
+			skb->priority = skb->sk->priority;
+		skb->dev = dev;
+		dev_queue_xmit(skb);
+		return 1;
+	}
 	 
 	/*
 	 *	Non ELAP we cannot do.
@@ -514,7 +535,7 @@
 		 *	Return 1 and fill in the address
 		 */
 
-		a->expires_at=jiffies+AARP_EXPIRY_TIME*10;
+		a->expires_at=jiffies+sysctl_aarp_expiry_time*10;
 		ddp_dl->datalink_header(ddp_dl, skb, a->hwaddr);
 		if(skb->sk==NULL)
 			skb->priority = SOPRI_NORMAL;
@@ -561,7 +582,7 @@
 	 */
 
 	skb_queue_tail(&a->packet_queue, skb);
-	a->expires_at=jiffies+AARP_RESOLVE_TIME;
+	a->expires_at=jiffies+sysctl_aarp_resolve_time;
 	a->dev=dev;
 	a->next=unresolved[hash];
 	a->target_addr= *sa;
@@ -584,7 +605,7 @@
 	if(unresolved_count==1)
 	{
 		del_timer(&aarp_timer);
-		aarp_timer.expires=jiffies+AARP_TICK_TIME;
+		aarp_timer.expires=jiffies+sysctl_aarp_tick_time;
 		add_timer(&aarp_timer);
 	}
 
@@ -623,7 +644,7 @@
 			 
 			while((skb=skb_dequeue(&a->packet_queue))!=NULL)
 			{
-				a->expires_at=jiffies+AARP_EXPIRY_TIME*10;
+				a->expires_at=jiffies+sysctl_aarp_expiry_time*10;
 				ddp_dl->datalink_header(ddp_dl,skb,a->hwaddr);
 				if(skb->sk==NULL)
 					skb->priority = SOPRI_NORMAL;
@@ -751,7 +772,7 @@
 			if(unresolved_count==0)
 			{
 				del_timer(&aarp_timer);
-				aarp_timer.expires=jiffies+AARP_EXPIRY_TIME;
+				aarp_timer.expires=jiffies+sysctl_aarp_expiry_time;
 				add_timer(&aarp_timer);
 			}
 			break;
@@ -804,7 +825,7 @@
 	init_timer(&aarp_timer);
 	aarp_timer.function=aarp_expire_timeout;
 	aarp_timer.data=0;
-	aarp_timer.expires=jiffies+AARP_EXPIRY_TIME;
+	aarp_timer.expires=jiffies+sysctl_aarp_expiry_time;
 	add_timer(&aarp_timer);
 	register_netdevice_notifier(&aarp_notifier);
 }

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