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

1998/0326/ip/ip.c (diff list | history)

1998/0314/sys/src/9/ip/ip.c:322,3301998/0326/sys/src/9/ip/ip.c:322,339 (short | long | prev | next)
Pull up 64 bytes instead of just an IP header, to help other protocols.
rsc Fri Mar 4 12:44:25 2005
1998/0313    
//	DBG(nhgetl(h->src))(Logipmsg, "ipiput %V %V len %d proto %d\n", 
//				h->src, h->dst, BLEN(bp), h->proto); 
1997/0327    
 
	/* Ensure we have enough data to process */ 
	if(BLEN(bp) < IPHDR) { 
		bp = pullupblock(bp, IPHDR); 
1998/0326    
	/* 
	 *  Ensure we have allt he header info in the first 
	 *  block.  Make life easier for other protocols by 
	 *  collecting up to the first 64 bytes in the first block. 
	 */ 
	if(BLEN(bp) < 64) { 
		hl = blocklen(bp); 
		if(hl < IPHDR) 
			hl = IPHDR; 
		if(hl > 64) 
			hl = 64; 
		bp = pullupblock(bp, hl); 
1997/0327    
		if(bp == nil) 
			return; 
	} 


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