X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Froute.c;h=69d0ba74a44be90fc376bfb436914c995dbd6998;hb=04d8a8e34e1fe7f33f1946863b36a24ee358175f;hp=aa5634c0b133e09a40ded6804243701a2e78c7df;hpb=1545909dcb3ac618754486f4ccd4d8f237d64bb7;p=tinc diff --git a/src/route.c b/src/route.c index aa5634c0..69d0ba74 100644 --- a/src/route.c +++ b/src/route.c @@ -485,7 +485,7 @@ static void clamp_mss(const node_t *source, const node_t *via, vpn_packet_t *pac csum += csum >> 16; csum ^= 0xffff; DATA(packet)[start + 16] = csum >> 8; - DATA(packet)[start + 17] = csum; + DATA(packet)[start + 17] = csum & 0xff; break; } } @@ -494,7 +494,7 @@ static void age_subnets(void *data) { (void)data; bool left = false; - for splay_each(subnet_t, s, myself->subnet_tree) { + for splay_each(subnet_t, s, &myself->subnet_tree) { if(s->expires && s->expires < now.tv_sec) { if(debug_level >= DEBUG_TRAFFIC) { char netstr[MAXNETSTR]; @@ -504,7 +504,7 @@ static void age_subnets(void *data) { } } - for list_each(connection_t, c, connection_list) + for list_each(connection_t, c, &connection_list) if(c->edge) { send_del_subnet(c, s); } @@ -543,7 +543,7 @@ static void learn_mac(mac_t *address) { /* And tell all other tinc daemons it's our MAC */ - for list_each(connection_t, c, connection_list) + for list_each(connection_t, c, &connection_list) if(c->edge) { send_add_subnet(c, subnet); } @@ -587,7 +587,7 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t et todo = ntohs(ip.ip_len) - ip_size; if(ether_size + ip_size + todo != packet->len) { - logger(DEBUG_TRAFFIC, LOG_WARNING, "Length of packet (%d) doesn't match length in IPv4 header (%d)", packet->len, (int)(ether_size + ip_size + todo)); + logger(DEBUG_TRAFFIC, LOG_WARNING, "Length of packet (%d) doesn't match length in IPv4 header (%zu)", packet->len, ether_size + ip_size + todo); return; } @@ -1111,7 +1111,7 @@ static void route_mac(node_t *source, vpn_packet_t *packet) { static void send_pcap(vpn_packet_t *packet) { pcap = false; - for list_each(connection_t, c, connection_list) { + for list_each(connection_t, c, &connection_list) { if(!c->status.pcap) { continue; } @@ -1124,7 +1124,7 @@ static void send_pcap(vpn_packet_t *packet) { } if(send_request(c, "%d %d %d", CONTROL, REQ_PCAP, len)) { - send_meta(c, (char *)DATA(packet), len); + send_meta(c, DATA(packet), len); } } }