X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fconnection.c;h=6d77cb560aba0497f9f32fc3012e7d42307cdf23;hp=430e1c149ec19d9307cb203947dab624177cd095;hb=c23fcf555ee4b69f03b76a0ffb731c3a475a77e7;hpb=9b394bc887695da6db74f4b9796b4823e553f8cc diff --git a/src/connection.c b/src/connection.c index 430e1c14..6d77cb56 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,6 +1,6 @@ /* connection.c -- connection list management - Copyright (C) 2000-2007 Guus Sliepen , + Copyright (C) 2000-2009 Guus Sliepen , 2000-2005 Ivo Timmermans This program is free software; you can redistribute it and/or modify @@ -37,7 +37,7 @@ connection_t *broadcast; static int connection_compare(const connection_t *a, const connection_t *b) { - return a - b; + return a < b ? -1 : a == b ? 0 : 1; } void init_connections(void) @@ -144,7 +144,7 @@ void dump_connections(void) for(node = connection_tree->head; node; node = node->next) { c = node->data; logger(LOG_DEBUG, _(" %s at %s options %lx socket %d status %04x outbuf %d/%d/%d"), - c->name, c->hostname, c->options, c->socket, *(uint32_t *)&c->status, + c->name, c->hostname, c->options, c->socket, bitfield_to_int(&c->status, sizeof c->status), c->outbufsize, c->outbufstart, c->outbuflen); }