We don't have to tell GCC how to cast.
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 28 Aug 2003 21:05:11 +0000 (21:05 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 28 Aug 2003 21:05:11 +0000 (21:05 +0000)
17 files changed:
lib/avl_tree.c
lib/list.c
src/conf.c
src/connection.c
src/edge.c
src/event.c
src/graph.c
src/linux/device.c
src/meta.c
src/net.c
src/net_packet.c
src/net_setup.c
src/node.c
src/protocol.c
src/protocol_auth.c
src/route.c
src/subnet.c

index 95e95e722528ddbf5e0caccc10f91db4d1a9f657..24f4a083fdc77a30c81a6c023b6813c303046cc9 100644 (file)
@@ -29,7 +29,7 @@
     library for inclusion into tinc (http://tinc.nl.linux.org/) by
     Guus Sliepen <guus@sliepen.eu.org>.
 
-    $Id: avl_tree.c,v 1.1.2.18 2003/07/30 21:52:41 guus Exp $
+    $Id: avl_tree.c,v 1.1.2.19 2003/08/28 21:05:09 guus Exp $
 */
 
 #include "system.h"
@@ -280,7 +280,7 @@ void avl_free_tree(avl_tree_t *tree)
 
 avl_node_t *avl_alloc_node(void)
 {
-       return (avl_node_t *)xmalloc_and_zero(sizeof(avl_node_t));
+       return xmalloc_and_zero(sizeof(avl_node_t));
 }
 
 void avl_free_node(avl_tree_t *tree, avl_node_t *node)
index 573bc9e15389e3671330b40d17d2a27a50aeccd9..98a301971095c20d4e9aa71dca271e78201598c7 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: list.c,v 1.1.2.16 2003/07/17 15:06:25 guus Exp $
+    $Id: list.c,v 1.1.2.17 2003/08/28 21:05:09 guus Exp $
 */
 
 #include "system.h"
@@ -44,7 +44,7 @@ void list_free(list_t *list)
 
 list_node_t *list_alloc_node(void)
 {
-       return (list_node_t *)xmalloc_and_zero(sizeof(list_node_t));
+       return xmalloc_and_zero(sizeof(list_node_t));
 }
 
 void list_free_node(list_t *list, list_node_t *node)
index 3feb150380f5a5f8d6491282226ce218f13a0e06..57bee09470b96152bd853f51941da62ea6019ece 100644 (file)
@@ -19,7 +19,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: conf.c,v 1.9.4.75 2003/08/08 22:11:54 guus Exp $
+    $Id: conf.c,v 1.9.4.76 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -73,7 +73,7 @@ config_t *new_config(void)
 {
        cp();
 
-       return (config_t *) xmalloc_and_zero(sizeof(config_t));
+       return xmalloc_and_zero(sizeof(config_t));
 }
 
 void free_config(config_t *cfg)
@@ -131,7 +131,7 @@ config_t *lookup_config_next(const avl_tree_t *config_tree, const config_t *cfg)
 
        if(node) {
                if(node->next) {
-                       found = (config_t *) node->next->data;
+                       found = node->next->data;
 
                        if(!strcasecmp(found->variable, cfg->variable))
                                return found;
index 65bf8966374e43f4145d63fabfa55e8d69a00894..b4a17ad31dbb685cb16f19bef88d09afa841b035 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: connection.c,v 1.1.2.43 2003/07/29 10:50:15 guus Exp $
+    $Id: connection.c,v 1.1.2.44 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -64,7 +64,7 @@ connection_t *new_connection(void)
 
        cp();
 
-       c = (connection_t *) xmalloc_and_zero(sizeof(connection_t));
+       c = xmalloc_and_zero(sizeof(connection_t));
 
        if(!c)
                return NULL;
@@ -120,7 +120,7 @@ void dump_connections(void)
        logger(LOG_DEBUG, _("Connections:"));
 
        for(node = connection_tree->head; node; node = node->next) {
-               c = (connection_t *) node->data;
+               c = node->data;
                logger(LOG_DEBUG, _(" %s at %s options %lx socket %d status %04x"),
                           c->name, c->hostname, c->options, c->socket, *(uint32_t *)&c->status);
        }
index 69f2c7f57273b874e0267078b4b592bfeea15604..bf43d304a575c9ddb78753dd046896ae8ccb58c6 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: edge.c,v 1.1.2.26 2003/08/22 11:18:42 guus Exp $
+    $Id: edge.c,v 1.1.2.27 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -88,7 +88,7 @@ edge_t *new_edge(void)
 {
        cp();
 
-       return (edge_t *) xmalloc_and_zero(sizeof(edge_t));
+       return xmalloc_and_zero(sizeof(edge_t));
 }
 
 void free_edge(edge_t *e)
@@ -148,9 +148,9 @@ void dump_edges(void)
        logger(LOG_DEBUG, _("Edges:"));
 
        for(node = node_tree->head; node; node = node->next) {
-               n = (node_t *) node->data;
+               n = node->data;
                for(node2 = n->edge_tree->head; node2; node2 = node2->next) {
-                       e = (edge_t *) node2->data;
+                       e = node2->data;
                        address = sockaddr2hostname(&e->address);
                        logger(LOG_DEBUG, _(" %s to %s at %s options %lx weight %d"),
                                   e->from->name, e->to->name, address, e->options, e->weight);
index 4e0f6a090e70bd6d08602ee39f31c1d74c2863ff..4d6431cb4a526bd7cf75f5cb1373f779492247a5 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: event.c,v 1.1.4.10 2003/07/24 12:08:15 guus Exp $
+    $Id: event.c,v 1.1.4.11 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -61,7 +61,7 @@ event_t *new_event(void)
 {
        cp();
 
-       return (event_t *) xmalloc_and_zero(sizeof(event_t));
+       return xmalloc_and_zero(sizeof(event_t));
 }
 
 void free_event(event_t *event)
@@ -93,7 +93,7 @@ event_t *get_expired_event(void)
        cp();
 
        if(event_tree->head) {
-               event = (event_t *) event_tree->head->data;
+               event = event_tree->head->data;
 
                if(event->time < now) {
                        avl_delete(event_tree, event);
index 6ec3724e8d6c59fa2a656cc4c28fb88d97a58790..b6e60e05471acea63dc0e7b4bc9b13dd188d5d4b 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: graph.c,v 1.1.2.28 2003/08/22 11:18:42 guus Exp $
+    $Id: graph.c,v 1.1.2.29 2003/08/28 21:05:10 guus Exp $
 */
 
 /* We need to generate two trees from the graph:
@@ -76,7 +76,7 @@ void mst_kruskal(void)
        /* Clear MST status on connections */
 
        for(node = connection_tree->head; node; node = node->next) {
-               c = (connection_t *) node->data;
+               c = node->data;
                c->status.mst = false;
        }
 
@@ -90,7 +90,7 @@ void mst_kruskal(void)
        /* Clear visited status on nodes */
 
        for(node = node_tree->head; node; node = node->next) {
-               n = (node_t *) node->data;
+               n = node->data;
                n->status.visited = false;
                nodes++;
        }
@@ -103,7 +103,7 @@ void mst_kruskal(void)
 
        for(skipped = false, node = edge_weight_tree->head; node; node = next) {
                next = node->next;
-               e = (edge_t *) node->data;
+               e = node->data;
 
                if(!e->reverse || e->from->status.visited == e->to->status.visited) {
                        skipped = true;
@@ -158,7 +158,7 @@ void sssp_bfs(void)
        /* Clear visited status on nodes */
 
        for(node = node_tree->head; node; node = node->next) {
-               n = (node_t *) node->data;
+               n = node->data;
                n->status.visited = false;
                n->status.indirect = true;
        }
@@ -178,10 +178,10 @@ void sssp_bfs(void)
        while(todo_tree->head) {
                for(from = todo_tree->head; from; from = next) {        /* "from" is the node from which we start */
                        next = from->next;
-                       n = (node_t *) from->data;
+                       n = from->data;
 
                        for(to = n->edge_tree->head; to; to = to->next) {       /* "to" is the edge connected to "from" */
-                               e = (edge_t *) to->data;
+                               e = to->data;
 
                                if(!e->reverse)
                                        continue;
@@ -245,7 +245,7 @@ void sssp_bfs(void)
 
        for(node = node_tree->head; node; node = next) {
                next = node->next;
-               n = (node_t *) node->data;
+               n = node->data;
 
                if(n->status.visited != n->status.reachable) {
                        n->status.reachable = !n->status.reachable;
index 904c36cba6282049eaa6072b8f6d3c48bb92fe80..0461278ef2509135604aa4a43e47fea8bf47d82d 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: device.c,v 1.1.2.20 2003/07/22 20:55:21 guus Exp $
+    $Id: device.c,v 1.1.2.21 2003/08/28 21:05:11 guus Exp $
 */
 
 #include "system.h"
@@ -94,10 +94,10 @@ bool setup_device(void)
        if(iface)
                strncpy(ifr.ifr_name, iface, IFNAMSIZ);
 
-       if(!ioctl(device_fd, TUNSETIFF, (void *) &ifr)) {
+       if(!ioctl(device_fd, TUNSETIFF, &ifr)) {
                strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
                iface = ifrname;
-       } else if(!ioctl(device_fd, (('T' << 8) | 202), (void *) &ifr)) {
+       } else if(!ioctl(device_fd, (('T' << 8) | 202), &ifr)) {
                logger(LOG_WARNING, _("Old ioctl() request was needed for %s"), device);
                strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
                iface = ifrname;
index d6bf135aad19fe2630806174e0b5e4e501def95d..dacb1df9fc9dda46b6ce3d24cad257c8bedca359 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: meta.c,v 1.1.2.43 2003/08/22 11:18:42 guus Exp $
+    $Id: meta.c,v 1.1.2.44 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -80,7 +80,7 @@ void broadcast_meta(connection_t *from, const char *buffer, int length)
        cp();
 
        for(node = connection_tree->head; node; node = node->next) {
-               c = (connection_t *) node->data;
+               c = node->data;
 
                if(c != from && c->status.active)
                        send_meta(c, buffer, length);
index d6f4403b487c117f9d9aaf6f6ea8dca339e7abcf..7bf39897621ce26a0225c098af28f1951c5d44dd 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net.c,v 1.35.4.199 2003/08/28 15:27:11 guus Exp $
+    $Id: net.c,v 1.35.4.200 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -63,7 +63,7 @@ static void purge(void)
 
        for(nnode = node_tree->head; nnode; nnode = nnext) {
                nnext = nnode->next;
-               n = (node_t *) nnode->data;
+               n = nnode->data;
 
                if(!n->status.reachable) {
                        ifdebug(SCARY_THINGS) logger(LOG_DEBUG, _("Purging node %s (%s)"), n->name,
@@ -71,14 +71,14 @@ static void purge(void)
 
                        for(snode = n->subnet_tree->head; snode; snode = snext) {
                                snext = snode->next;
-                               s = (subnet_t *) snode->data;
+                               s = snode->data;
                                send_del_subnet(broadcast, s);
                                subnet_del(n, s);
                        }
 
                        for(enode = n->edge_tree->head; enode; enode = enext) {
                                enext = enode->next;
-                               e = (edge_t *) enode->data;
+                               e = enode->data;
                                send_del_edge(broadcast, e);
                                edge_del(e);
                        }
@@ -89,12 +89,12 @@ static void purge(void)
 
        for(nnode = node_tree->head; nnode; nnode = nnext) {
                nnext = nnode->next;
-               n = (node_t *) nnode->data;
+               n = nnode->data;
 
                if(!n->status.reachable) {
                        for(enode = edge_weight_tree->head; enode; enode = enext) {
                                enext = enode->next;
-                               e = (edge_t *) enode->data;
+                               e = enode->data;
 
                                if(e->to == n)
                                        break;
@@ -122,7 +122,7 @@ static int build_fdset(fd_set * fs)
 
        for(node = connection_tree->head; node; node = next) {
                next = node->next;
-               c = (connection_t *) node->data;
+               c = node->data;
 
                if(c->status.remove) {
                        connection_del(c);
@@ -224,7 +224,7 @@ static void check_dead_connections(void)
 
        for(node = connection_tree->head; node; node = next) {
                next = node->next;
-               c = (connection_t *) node->data;
+               c = node->data;
 
                if(c->last_ping_time + pingtimeout < now) {
                        if(c->status.active) {
@@ -271,7 +271,7 @@ static void check_network_activity(fd_set * f)
        }
 
        for(node = connection_tree->head; node; node = node->next) {
-               c = (connection_t *) node->data;
+               c = node->data;
 
                if(c->status.remove)
                        continue;
@@ -391,7 +391,7 @@ int main_loop(void)
                        logger(LOG_INFO, _("Flushing event queue"));
 
                        while(event_tree->head) {
-                               event = (event_t *) event_tree->head->data;
+                               event = event_tree->head->data;
                                event->handler(event->data);
                                event_del(event);
                        }
@@ -419,7 +419,7 @@ int main_loop(void)
                        /* Close connections to hosts that have a changed or deleted host config file */
                        
                        for(node = connection_tree->head; node; node = node->next) {
-                               c = (connection_t *) node->data;
+                               c = node->data;
                                
                                if(c->outgoing) {
                                        free(c->outgoing->name);
index 8f47f23f2fabb718abca875b20aeddb691dcff20..43b8e7cdc0fe634b26afb0bfd9b3fcabce2c199e 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net_packet.c,v 1.1.2.39 2003/08/22 11:18:42 guus Exp $
+    $Id: net_packet.c,v 1.1.2.40 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -367,7 +367,7 @@ void broadcast_packet(const node_t *from, vpn_packet_t *packet)
                           packet->len, from->name, from->hostname);
 
        for(node = connection_tree->head; node; node = node->next) {
-               c = (connection_t *) node->data;
+               c = node->data;
 
                if(c->status.active && c->status.mst && c != from->nexthop->connection)
                        send_packet(c->node, packet);
@@ -384,7 +384,7 @@ void flush_queue(node_t *n)
 
        for(node = n->queue->head; node; node = next) {
                next = node->next;
-               send_udppacket(n, (vpn_packet_t *) node->data);
+               send_udppacket(n, node->data);
                list_delete_node(n->queue, node);
        }
 }
index 3ab91a0529613f314504b767da95f5052fb6aaf4..c3cfb0fc49a7dd25fda4fc067b67e903db44c668 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net_setup.c,v 1.1.2.43 2003/08/14 14:21:35 guus Exp $
+    $Id: net_setup.c,v 1.1.2.44 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -362,7 +362,7 @@ bool setup_myself(void)
 
        myself->connection->outcipher = EVP_bf_ofb();
 
-       myself->key = (char *) xmalloc(myself->keylength);
+       myself->key = xmalloc(myself->keylength);
        RAND_pseudo_bytes(myself->key, myself->keylength);
 
        if(!get_config_int(lookup_config(config_tree, "KeyExpire"), &keylifetime))
@@ -549,7 +549,7 @@ void close_network_connections(void)
 
        for(node = connection_tree->head; node; node = next) {
                next = node->next;
-               c = (connection_t *) node->data;
+               c = node->data;
 
                if(c->outgoing)
                        free(c->outgoing->name), free(c->outgoing), c->outgoing = NULL;
index f40fb19ed26a403b62ed619eba6cd09beb31171f..0fdc1dcc1c1528f5951539d6fd2e433e51f86a6b 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: node.c,v 1.1.2.27 2003/08/22 11:18:42 guus Exp $
+    $Id: node.c,v 1.1.2.28 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -72,7 +72,7 @@ void exit_nodes(void)
 
 node_t *new_node(void)
 {
-       node_t *n = (node_t *) xmalloc_and_zero(sizeof(*n));
+       node_t *n = xmalloc_and_zero(sizeof(*n));
 
        cp();
 
@@ -131,13 +131,13 @@ void node_del(node_t *n)
 
        for(node = n->subnet_tree->head; node; node = next) {
                next = node->next;
-               s = (subnet_t *) node->data;
+               s = node->data;
                subnet_del(n, s);
        }
 
        for(node = n->edge_tree->head; node; node = next) {
                next = node->next;
-               e = (edge_t *) node->data;
+               e = node->data;
                edge_del(e);
        }
 
@@ -178,7 +178,7 @@ void dump_nodes(void)
        logger(LOG_DEBUG, _("Nodes:"));
 
        for(node = node_tree->head; node; node = node->next) {
-               n = (node_t *) node->data;
+               n = node->data;
                logger(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s"),
                           n->name, n->hostname, n->cipher ? n->cipher->nid : 0,
                           n->digest ? n->digest->type : 0, n->maclength, n->compression,
index 0d58d6a8e8ad7d53146431eb04466ac5d4236d54..4e37bf5523b76f721b40974230777ca0a3022467 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol.c,v 1.28.4.146 2003/08/03 12:38:43 guus Exp $
+    $Id: protocol.c,v 1.28.4.147 2003/08/28 21:05:10 guus Exp $
 */
 
 #include "system.h"
@@ -219,7 +219,7 @@ bool seen_request(char *request)
                ifdebug(SCARY_THINGS) logger(LOG_DEBUG, _("Already seen request"));
                return true;
        } else {
-               new = (past_request_t *) xmalloc(sizeof(*new));
+               new = xmalloc(sizeof(*new));
                new->request = xstrdup(request);
                new->firstseen = now;
                avl_insert(past_request_tree, new);
@@ -237,7 +237,7 @@ void age_past_requests(void)
 
        for(node = past_request_tree->head; node; node = next) {
                next = node->next;
-               p = (past_request_t *) node->data;
+               p = node->data;
 
                if(p->firstseen + pingtimeout < now)
                        avl_delete_node(past_request_tree, node), deleted++;
index d2962e7254bd98f963fa509dba096c74bbedc0eb..dafcc20c2d29a1e49b1541296e25b7bce2d5514f 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_auth.c,v 1.1.4.25 2003/07/22 20:55:20 guus Exp $
+    $Id: protocol_auth.c,v 1.1.4.26 2003/08/28 21:05:11 guus Exp $
 */
 
 #include "system.h"
@@ -473,15 +473,15 @@ static void send_everything(connection_t *c)
        /* Send all known subnets and edges */
 
        for(node = node_tree->head; node; node = node->next) {
-               n = (node_t *) node->data;
+               n = node->data;
 
                for(node2 = n->subnet_tree->head; node2; node2 = node2->next) {
-                       s = (subnet_t *) node2->data;
+                       s = node2->data;
                        send_add_subnet(c, s);
                }
 
                for(node2 = n->edge_tree->head; node2; node2 = node2->next) {
-                       e = (edge_t *) node2->data;
+                       e = node2->data;
                        send_add_edge(c, e);
                }
        }
index 5823f379a529d5d72f2e1f62ee30973bf1a64018..16d932d33ca36041372014d0076cdce481114f01 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: route.c,v 1.1.2.63 2003/07/31 13:18:34 guus Exp $
+    $Id: route.c,v 1.1.2.64 2003/08/28 21:05:11 guus Exp $
 */
 
 #include "system.h"
@@ -113,7 +113,7 @@ static void learn_mac(mac_t *address)
                /* And tell all other tinc daemons it's our MAC */
 
                for(node = connection_tree->head; node; node = node->next) {
-                       c = (connection_t *) node->data;
+                       c = node->data;
                        if(c->status.active)
                                send_add_subnet(c, subnet);
                }
@@ -132,7 +132,7 @@ void age_mac(void)
 
        for(node = myself->subnet_tree->head; node; node = next) {
                next = node->next;
-               s = (subnet_t *) node->data;
+               s = node->data;
                if(s->type == SUBNET_MAC && s->net.mac.lastseen && s->net.mac.lastseen + macexpire < now) {
                        ifdebug(TRAFFIC) logger(LOG_INFO, _("MAC address %hx:%hx:%hx:%hx:%hx:%hx expired"),
                                           s->net.mac.address.x[0], s->net.mac.address.x[1],
@@ -140,7 +140,7 @@ void age_mac(void)
                                           s->net.mac.address.x[4], s->net.mac.address.x[5]);
 
                        for(node2 = connection_tree->head; node2; node2 = node2->next) {
-                               c = (connection_t *) node2->data;
+                               c = node2->data;
                                if(c->status.active)
                                        send_del_subnet(c, s);
                        }
@@ -240,7 +240,7 @@ static node_t *route_ipv4(vpn_packet_t *packet)
        if(priorityinheritance)
                packet->priority = packet->data[15];
 
-       subnet = lookup_subnet_ipv4((ipv4_t *) & packet->data[30]);
+       subnet = lookup_subnet_ipv4((ipv4_t *) &packet->data[30]);
 
        if(!subnet) {
                ifdebug(TRAFFIC) logger(LOG_WARNING, _("Cannot route packet: unknown IPv4 destination address %d.%d.%d.%d"),
@@ -331,18 +331,18 @@ static node_t *route_ipv6(vpn_packet_t *packet)
 
        cp();
 
-       subnet = lookup_subnet_ipv6((ipv6_t *) & packet->data[38]);
+       subnet = lookup_subnet_ipv6((ipv6_t *) &packet->data[38]);
 
        if(!subnet) {
                ifdebug(TRAFFIC) logger(LOG_WARNING, _("Cannot route packet: unknown IPv6 destination address %hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx"),
-                                  ntohs(*(uint16_t *) & packet->data[38]),
-                                  ntohs(*(uint16_t *) & packet->data[40]),
-                                  ntohs(*(uint16_t *) & packet->data[42]),
-                                  ntohs(*(uint16_t *) & packet->data[44]),
-                                  ntohs(*(uint16_t *) & packet->data[46]),
-                                  ntohs(*(uint16_t *) & packet->data[48]),
-                                  ntohs(*(uint16_t *) & packet->data[50]),
-                                  ntohs(*(uint16_t *) & packet->data[52]));
+                                  ntohs(*(uint16_t *) &packet->data[38]),
+                                  ntohs(*(uint16_t *) &packet->data[40]),
+                                  ntohs(*(uint16_t *) &packet->data[42]),
+                                  ntohs(*(uint16_t *) &packet->data[44]),
+                                  ntohs(*(uint16_t *) &packet->data[46]),
+                                  ntohs(*(uint16_t *) &packet->data[48]),
+                                  ntohs(*(uint16_t *) &packet->data[50]),
+                                  ntohs(*(uint16_t *) &packet->data[52]));
                route_ipv6_unreachable(packet, ICMP6_DST_UNREACH_ADDR);
 
                return NULL;
@@ -409,18 +409,18 @@ static void route_neighborsol(vpn_packet_t *packet)
 
        /* Check if the IPv6 address exists on the VPN */
 
-       subnet = lookup_subnet_ipv6((ipv6_t *) & ns->nd_ns_target);
+       subnet = lookup_subnet_ipv6((ipv6_t *) &ns->nd_ns_target);
 
        if(!subnet) {
                ifdebug(TRAFFIC) logger(LOG_WARNING, _("Cannot route packet: neighbor solicitation request for unknown address %hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx"),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[0]),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[1]),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[2]),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[3]),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[4]),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[5]),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[6]),
-                                  ntohs(((uint16_t *) & ns->nd_ns_target)[7]));
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[0]),
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[1]),
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[2]),
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[3]),
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[4]),
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[5]),
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[6]),
+                                  ntohs(((uint16_t *) &ns->nd_ns_target)[7]));
 
                return;
        }
index 36d1627ed3425d115371345b15f316c8291326b1..5d88ca688baee41aa9899be67e4378f2a4e54c5c 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: subnet.c,v 1.1.2.49 2003/07/30 11:50:45 guus Exp $
+    $Id: subnet.c,v 1.1.2.50 2003/08/28 21:05:11 guus Exp $
 */
 
 #include "system.h"
@@ -145,7 +145,7 @@ subnet_t *new_subnet(void)
 {
        cp();
 
-       return (subnet_t *) xmalloc_and_zero(sizeof(subnet_t));
+       return xmalloc_and_zero(sizeof(subnet_t));
 }
 
 void free_subnet(subnet_t *subnet)
@@ -313,7 +313,7 @@ subnet_t *lookup_subnet_mac(const mac_t *address)
        subnet.net.mac.address = *address;
        subnet.owner = NULL;
 
-       p = (subnet_t *) avl_search(subnet_tree, &subnet);
+       p = avl_search(subnet_tree, &subnet);
 
        return p;
 }
@@ -332,7 +332,7 @@ subnet_t *lookup_subnet_ipv4(const ipv4_t *address)
        do {
                /* Go find subnet */
 
-               p = (subnet_t *) avl_search_closest_smaller(subnet_tree, &subnet);
+               p = avl_search_closest_smaller(subnet_tree, &subnet);
 
                /* Check if the found subnet REALLY matches */
 
@@ -370,7 +370,7 @@ subnet_t *lookup_subnet_ipv6(const ipv6_t *address)
        do {
                /* Go find subnet */
 
-               p = (subnet_t *) avl_search_closest_smaller(subnet_tree, &subnet);
+               p = avl_search_closest_smaller(subnet_tree, &subnet);
 
                /* Check if the found subnet REALLY matches */
 
@@ -403,7 +403,7 @@ void dump_subnets(void)
        logger(LOG_DEBUG, _("Subnet list:"));
 
        for(node = subnet_tree->head; node; node = node->next) {
-               subnet = (subnet_t *) node->data;
+               subnet = node->data;
                netstr = net2str(subnet);
                logger(LOG_DEBUG, _(" %s owner %s"), netstr, subnet->owner->name);
                free(netstr);