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

1997/0524/ip/gre.c (diff list | history)

1997/0522/sys/src/9/ip/gre.c:121,1281997/0524/sys/src/9/ip/gre.c:121,127 (short | long | prev | next)
1997/0327    
grekick(Conv *c, int l) 
{ 
	GREhdr *ghp; 
	Block *bp, *f; 
	int dlen; 
1997/0524    
	Block *bp; 
1997/0327    
 
	USED(l); 
 
1997/0522/sys/src/9/ip/gre.c:129,1461997/0524/sys/src/9/ip/gre.c:128,133
1997/0327    
	bp = qget(c->wq); 
	if(bp == nil) 
		return; 
                 
	/* Round packet up to even number of bytes */ 
	dlen = blocklen(bp); 
	if(dlen & 1) { 
		for(f = bp; f->next; f = f->next) 
			; 
		if(f->wp >= f->lim) { 
			f->next = allocb(1); 
			f = f->next; 
		} 
		*f->wp++ = 0; 
	} 
 
	/* Make space to fit ip header (gre header already there) */ 
	bp = padblock(bp, GRE_IPHDRSIZE); 


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