trc = GNUNET_NO;
for (i=0;i<p->num_queries;i++)
{
- ret = GNUNET_DNSPARSER_builder_add_query (tmp, sizeof (tmp), &off, &p->queries[i]);
+ ret = GNUNET_DNSPARSER_builder_add_query (tmp,
+ sizeof (tmp),
+ &off,
+ &p->queries[i]);
if (GNUNET_SYSERR == ret)
return GNUNET_SYSERR;
if (GNUNET_NO == ret)
}
for (i=0;i<p->num_answers;i++)
{
- ret = add_record (tmp, sizeof (tmp), &off, &p->answers[i]);
+ ret = add_record (tmp,
+ sizeof (tmp),
+ &off,
+ &p->answers[i]);
if (GNUNET_SYSERR == ret)
return GNUNET_SYSERR;
if (GNUNET_NO == ret)
}
for (i=0;i<p->num_authority_records;i++)
{
- ret = add_record (tmp, sizeof (tmp), &off, &p->authority_records[i]);
+ ret = add_record (tmp,
+ sizeof (tmp),
+ &off,
+ &p->authority_records[i]);
if (GNUNET_SYSERR == ret)
return GNUNET_SYSERR;
if (GNUNET_NO == ret)
}
for (i=0;i<p->num_additional_records;i++)
{
- ret = add_record (tmp, sizeof (tmp), &off, &p->additional_records[i]);
+ ret = add_record (tmp,
+ sizeof (tmp),
+ &off,
+ &p->additional_records[i]);
if (GNUNET_SYSERR == ret)
return GNUNET_SYSERR;
if (GNUNET_NO == ret)
if (GNUNET_YES == trc)
dns.flags.message_truncated = 1;
- GNUNET_memcpy (tmp, &dns, sizeof (struct GNUNET_TUN_DnsHeader));
+ GNUNET_memcpy (tmp,
+ &dns,
+ sizeof (struct GNUNET_TUN_DnsHeader));
*buf = GNUNET_malloc (off);
*buf_length = off;
- GNUNET_memcpy (*buf, tmp, off);
+ GNUNET_memcpy (*buf,
+ tmp,
+ off);
if (GNUNET_YES == trc)
return GNUNET_NO;
return GNUNET_OK;
struct GNUNET_DNSPARSER_Packet *p;
char *dns_request;
size_t dns_request_length;
+ int ret;
ac = rh->ac_tail;
GNUNET_assert (NULL != ac);
UINT16_MAX);
p->flags.opcode = GNUNET_TUN_DNS_OPCODE_QUERY;
p->flags.recursion_desired = 1;
- if (GNUNET_OK !=
- GNUNET_DNSPARSER_pack (p, 1024, &dns_request, &dns_request_length))
+ ret = GNUNET_DNSPARSER_pack (p,
+ 1024,
+ &dns_request,
+ &dns_request_length);
+ if (GNUNET_OK != ret)
{
GNUNET_break (0);
- rh->proc (rh->proc_cls, 0, NULL);
+ rh->proc (rh->proc_cls,
+ 0,
+ NULL);
GNS_resolver_lookup_cancel (rh);
}
else
&fail_resolution,
rh);
}
- GNUNET_free (dns_request);
+ if (GNUNET_SYSERR != ret)
+ GNUNET_free (dns_request);
GNUNET_DNSPARSER_free_packet (p);
}
vpn_ctx->rd_data = GNUNET_malloc (vpn_ctx->rd_data_size);
vpn_ctx->rd_count = rd_count;
GNUNET_assert (vpn_ctx->rd_data_size ==
- GNUNET_GNSRECORD_records_serialize (rd_count,
- rd,
- vpn_ctx->rd_data_size,
- vpn_ctx->rd_data));
+ (size_t) GNUNET_GNSRECORD_records_serialize (rd_count,
+ rd,
+ vpn_ctx->rd_data_size,
+ vpn_ctx->rd_data));
vpn_ctx->vpn_request = GNUNET_VPN_redirect_to_peer (vpn_handle,
af,
ntohs (vpn->proto),