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

1991/1029/port/devarp.c (diff list | history)

1991/1029/sys/src/9/port/devarp.c:282,2881991/1030/sys/src/9/port/devarp.c:282,287 (short | long | prev | next)
1991/1029    
 
	if(bp->type != M_DATA) { 
		if(Servq == 0 && streamparse("arpd", bp)) { 
print("setting arp channel\n"); 
			Servq = RD(q); 
			freeb(bp); 
		} 
1991/1029/sys/src/9/port/devarp.c:298,3141991/1030/sys/src/9/port/devarp.c:297,316
1991/1029    
	} 
 
	eh = (Etherhdr *)bp->rptr; 
1991/1030    
	if(nhgets(eh->type) != ET_IP) { 
		PUTNEXT(q, bp);	 
		return; 
	} 
 
1991/1029    
	iproute(eh->dst, ip); 
 
	/* Send downstream to the ethernet */ 
	if(arplookup(ip, eh->d)) { 
print("arp hit %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]); 
		PUTNEXT(q, bp); 
		return; 
	} 
print("arp miss %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]); 
 
	/* Return the packet to the arp server for address resolution */ 
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)