From 3c6ad720d7a3be6901f747c46a5700b9380c5993 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 26 Oct 2011 07:35:23 +0000 Subject: [PATCH] fix compiler warnings --- src/vpn/gnunet-daemon-vpn-helper.c | 8 ++++++-- src/vpn/gnunet-helper-vpn.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index 4333cfb11..84f1105f6 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c @@ -277,6 +277,8 @@ helper_write (void *cls memcpy (&pkt->udp_dns.data, ans->pkt.data, data_len); buf = pkt; } + else + GNUNET_assert (0); GNUNET_CONTAINER_DLL_remove (answer_proc_head, answer_proc_tail, ans); GNUNET_free (ans); @@ -318,6 +320,7 @@ message_token (void *cls __attribute__ ((unused)), void *client struct ip6_udp *pkt6_udp; struct ip6_icmp *pkt6_icmp; + pkt6_udp = NULL; /* make compiler happy */ switch (pkt6->ip6_hdr.nxthdr) { case IPPROTO_UDP: @@ -347,7 +350,8 @@ message_token (void *cls __attribute__ ((unused)), void *client GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL); break; - } + } + /* fall through */ case IPPROTO_TCP: pkt6_tcp = (struct ip6_tcp *) pkt6; @@ -436,7 +440,7 @@ message_token (void *cls __attribute__ ((unused)), void *client memcpy (s->addr, me->addr, me->addrlen); s->proto = pkt6->ip6_hdr.nxthdr; if (s->proto == IPPROTO_UDP) - { + { hdr->type = htons (GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP); memcpy (hc + 1, &pkt6_udp->udp_hdr, ntohs (pkt6_udp->udp_hdr.len)); app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; diff --git a/src/vpn/gnunet-helper-vpn.c b/src/vpn/gnunet-helper-vpn.c index ed97770cf..c846c48ff 100644 --- a/src/vpn/gnunet-helper-vpn.c +++ b/src/vpn/gnunet-helper-vpn.c @@ -304,7 +304,7 @@ run (int fd_tun) */ unsigned char buftun[MAX_SIZE]; ssize_t buftun_size = 0; - unsigned char *buftun_read; + unsigned char *buftun_read = NULL; /* * The buffer filled by reading from stdin -- 2.25.1