Fix compiler warnings.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 25 Jun 2012 17:01:51 +0000 (19:01 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 25 Jun 2012 17:01:51 +0000 (19:01 +0200)
src/linux/device.c
src/net_socket.c

index cbf215298dd635e8ff1d2cb869c6d93d114e4862..5ae89478c44254e36ca25c05e147259ad108c6db 100644 (file)
@@ -210,7 +210,7 @@ static bool write_packet(vpn_packet_t *packet) {
                        }
                        break;
                case DEVICE_TYPE_ETHERTAP:
-                       *(short int *)(packet->data - 2) = packet->len;
+                       memcpy(packet->data - 2, &packet->len, 2);
 
                        if(write(device_fd, packet->data - 2, packet->len + 2) < 0) {
                                logger(LOG_ERR, "Can't write to %s %s: %s", device_info, device,
index f49832f806a0ebad09d612ffdcc6323be6457190..2d1ecc50e83f40ed5d03590e49a8a7a6e6e13182 100644 (file)
@@ -352,7 +352,7 @@ static void do_outgoing_pipe(connection_t *c, char *command) {
 
 void do_outgoing_connection(connection_t *c) {
        char *address, *port, *space;
-       struct addrinfo *proxyai;
+       struct addrinfo *proxyai = NULL;
        int result;
 
        if(!c->outgoing) {