X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Froute.c;h=dcc6f3c6bfc32d9d2824ce342ee23027c613dec0;hp=a3e92020ce4bcc47c2aa10be772990b92cb73c61;hb=b0ffeb7eeb21920842382c302ca15ec0d758e9b6;hpb=1b777010e7255cb354e31ca28c6442ee86383bac diff --git a/src/route.c b/src/route.c index a3e92020..dcc6f3c6 100644 --- a/src/route.c +++ b/src/route.c @@ -59,6 +59,7 @@ static const size_t opt_size = sizeof(struct nd_opt_hdr); #define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif +volatile int dummy; static timeout_t age_subnets_timeout; /* RFC 1071 */ @@ -80,6 +81,11 @@ static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) { checksum = (checksum & 0xFFFF) + (checksum >> 16); } + // Work around a compiler optimization bug. + if(checksum) { + dummy = 1; + } + return ~checksum; } @@ -489,6 +495,7 @@ static void clamp_mss(const node_t *source, const node_t *via, vpn_packet_t *pac } static void age_subnets(void *data) { + (void)data; bool left = false; for splay_each(subnet_t, s, myself->subnet_tree) { @@ -900,7 +907,7 @@ static void route_neighborsol(node_t *source, vpn_packet_t *packet) { memcpy(DATA(packet), DATA(packet) + ETH_ALEN, ETH_ALEN); /* copy destination address */ DATA(packet)[ETH_ALEN * 2 - 1] ^= 0xFF; /* mangle source address so it looks like it's not from us */ - ip6.ip6_dst = ip6.ip6_src; /* swap destination and source protocoll address */ + ip6.ip6_dst = ip6.ip6_src; /* swap destination and source protocol address */ ip6.ip6_src = ns.nd_ns_target; if(has_opt) {