plan 9 kernel history: overview | file list | diff list

1992/0214/port/devarp.c (diff list | history)

1992/0213/sys/src/9/port/devarp.c:320,3321992/0214/sys/src/9/port/devarp.c:320,325 (short | long | prev | next)
1991/1029    
		return; 
	} 
 
	if(!Servq) { 
1992/0213    
		if((dropped++ % 1000) == 0) 
			print("arp: No server, packet dropped\n"); 
1991/1029    
		freeb(bp); 
		return; 
	} 
                 
	eh = (Etherhdr *)bp->rptr; 
1991/1030    
	if(nhgets(eh->type) != ET_IP) { 
		PUTNEXT(q, bp);	 
1992/0213/sys/src/9/port/devarp.c:333,3381992/0214/sys/src/9/port/devarp.c:326,339
1991/1030    
		return; 
	} 
 
1992/0214    
	/* if ip broadcast, use ether bcast address */ 
	addr = nhgetl(eh->dst); 
	if(addr == Myip[Mybcast] || addr == Myip[Mynet] || addr == Myip[Mysubnet]){ 
		memset(eh->d, 0xff, sizeof(eh->d)); 
		PUTNEXT(q, bp); 
		return; 
	} 
 
1991/1029    
	iproute(eh->dst, ip); 
 
1992/0213    
	/* if a known ip addr, send downstream to the ethernet */ 
1992/0213/sys/src/9/port/devarp.c:341,3551992/0214/sys/src/9/port/devarp.c:342,355
1991/1029    
		return; 
	} 
 
1992/0213    
	/* if ip broadcast, use ether bcast address */ 
	addr = nhgetl(eh->dst); 
	if(addr == Myip[Mybcast] || addr == Myip[Mynet] || addr == Myip[Mysubnet]){ 
		memset(eh->d, 0xff, sizeof(eh->d)); 
		PUTNEXT(q, bp); 
1992/0214    
	/* Push the packet up to the arp server for address resolution */ 
	if(!Servq) { 
		if((dropped++ % 1000) == 0) 
			print("arp: No server, packet dropped %d.%d.%d.%d\n", 
				eh->dst[0], eh->dst[1], eh->dst[2], eh->dst[3]); 
		freeb(bp); 
1992/0213    
		return; 
	} 
                 
1991/1030    
	/* Push the packet up to the arp server for address resolution */ 
1991/1029    
	memmove(eh->d, ip, sizeof(ip)); 
	PUTNEXT(Servq, bp); 
1991/1027    
} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)