Change scope of len

This commit is contained in:
thorkill 2016-05-25 22:45:07 +02:00
parent 9ab8d025ca
commit e51ce69079

View file

@ -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;