[1208] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Threee quick bug fixes

daemon@ATHENA.MIT.EDU (A.Cox)
Fri Oct 13 02:40:00 1995

Date: Thu, 12 Oct 95 08:25 BST
From: anarchy@thunder.swansea.linux.org.uk (A.Cox)
To: torvalds@linux.helsinki.fi
Cc: linux-net@vger.rutgers.edu


--- icmp.c.old	Wed Oct 11 21:54:22 1995
+++ icmp.c	Wed Oct 11 21:54:23 1995
@@ -15,6 +15,7 @@
  *
  *	Fixes:
  *		Mike Shaver	:	RFC1122 checks.
+ *		Alan Cox	:	Multicast ping reply as self.
  *
  *
  *
@@ -455,7 +456,11 @@
 			ip_rt_add((RTF_DYNAMIC | RTF_MODIFIED | RTF_GATEWAY),
 				ip, 0, icmph->un.gateway, dev,0, 0, 0);
 #endif
-			break;
+			/*
+			 *	As per RFC recommendations now handle it as
+			 *	a host redirect.
+			 */
+			 
 		case ICMP_REDIR_HOST:
 			/*
 			 *	Add better route to host.
@@ -632,7 +637,7 @@
 	 *	Parse the ICMP message 
 	 */
 
-	if (daddr!=dev->pa_addr && ip_chk_addr(daddr) == IS_BROADCAST)
+	if (daddr!=dev->pa_addr && ip_chk_addr(daddr) != IS_MYADDR)
 	{
 		/*
 		 *	RFC 1122: 3.2.2.6 An ICMP_ECHO to broadcast MAY be silently ignored (we don't as it is used
@@ -645,6 +650,11 @@
 			kfree_skb(skb, FREE_READ);
 			return(0);
   		}
+  		/*
+  		 *	Reply the multicast/broadcast using a legal
+  		 *	interface - in this case the device we got
+  		 *	it from.
+  		 */
 		daddr=dev->pa_addr;
 	}
 	
--- impr.c.old	Wed Oct 11 22:02:00 1995
+++ ipmr.c	Wed Oct 11 22:02:00 1995
@@ -374,6 +374,7 @@
 			sti();
 			return 0;
 		}
+		sti();
 		return -ENOENT;
 	}
 	if(cache)
@@ -398,16 +399,21 @@
 	/*
 	 *	Unsolicited update - thats ok add anyway.
 	 */
-	sti();
-	cache=ipmr_cache_alloc(GFP_KERNEL);
+	 
+	
+	cache=ipmr_cache_alloc(GFP_ATOMIC);
 	if(cache==NULL)
+	{
+		sti();
 		return -ENOMEM;
+	}
 	cache->mfc_flags=MFC_RESOLVED;
 	cache->mfc_origin=mfc->mfcc_origin.s_addr;
 	cache->mfc_mcastgrp=mfc->mfcc_mcastgrp.s_addr;
 	cache->mfc_parent=mfc->mfcc_parent;
 	memcpy(cache->mfc_ttls, mfc->mfcc_ttls,sizeof(cache->mfc_ttls));
 	ipmr_cache_insert(cache);
+	sti();
 	return 0;
 }
  
--- pi2.c.old	Thu Oct 12 01:24:45 1995
+++ pi2.c	Thu Oct 12 01:24:45 1995
@@ -657,6 +657,7 @@
 		/* 'skb->data' points to the start of sk_buff data area. */
 		memcpy(cfix, lp->rcvbuf->data, pkt_len - 1);
 		skb->protocol=ntohs(ETH_P_AX25);
+		skb->mac.raw=skb->data;
 		IS_SKB(skb);
 		netif_rx(skb);
 		lp->stats.rx_packets++;



home help back first fref pref prev next nref lref last post