Change scope of len
This commit is contained in:
		
							parent
							
								
									9ab8d025ca
								
							
						
					
					
						commit
						e51ce69079
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -516,7 +516,7 @@ static void route_broadcast(node_t *source, vpn_packet_t *packet) {
 | 
			
		|||
static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t ether_size) {
 | 
			
		||||
	struct ip ip;
 | 
			
		||||
	vpn_packet_t fragment;
 | 
			
		||||
	int len, maxlen, todo;
 | 
			
		||||
	int maxlen, todo;
 | 
			
		||||
	uint8_t *offset;
 | 
			
		||||
	uint16_t ip_off, origf;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -543,7 +543,7 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t et
 | 
			
		|||
	ip_off &= IP_OFFMASK;
 | 
			
		||||
 | 
			
		||||
	while(todo) {
 | 
			
		||||
		len = todo > maxlen ? maxlen : todo;
 | 
			
		||||
		int len = todo > maxlen ? maxlen : todo;
 | 
			
		||||
		memcpy(DATA(&fragment) + ether_size + ip_size, offset, len);
 | 
			
		||||
		todo -= len;
 | 
			
		||||
		offset += len;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue