summaryrefslogtreecommitdiff
path: root/src/dnsstub/dns_resolve.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-09 14:41:53 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-09 14:41:53 +0200
commit5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (patch)
tree684758441f5b431d0008253243034b6a4a29417c /src/dnsstub/dns_resolve.c
parent249866e3d1e11dc72eaa1305f4bb479ded92ef38 (diff)
initial clang-format
Diffstat (limited to 'src/dnsstub/dns_resolve.c')
-rw-r--r--src/dnsstub/dns_resolve.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/dnsstub/dns_resolve.c b/src/dnsstub/dns_resolve.c
index bcc4308..90c5615 100644
--- a/src/dnsstub/dns_resolve.c
+++ b/src/dnsstub/dns_resolve.c
@@ -1,8 +1,8 @@
-#include "iopause.h"
-#include "taia.h"
#include "byte.h"
-#include "ip.h"
#include "dnsresolv.h"
+#include "iopause.h"
+#include "ip.h"
+#include "taia.h"
/**
@file dns_resolve.c
@@ -13,7 +13,7 @@
struct dns_transmit dns_resolve_tx = {0};
-int dns_resolve(const char *q,const char qtype[2])
+int dns_resolve(const char *q, const char qtype[2])
{
struct taia stamp;
struct taia deadline;
@@ -22,17 +22,18 @@ int dns_resolve(const char *q,const char qtype[2])
iopause_fd x[1];
int r;
- if (dns_resolvconfip(servers,scopes) < 0) return DNS_INT;
+ if (dns_resolvconfip(servers, scopes) < 0) return DNS_INT;
- if (dns_transmit_start6(&dns_resolve_tx,servers,1,q,qtype,(const char *)V6localnet,scopes) < 0) return DNS_COM;
+ if (dns_transmit_start6(&dns_resolve_tx, servers, 1, q, qtype, (const char *)V6localnet, scopes) < 0)
+ return DNS_COM;
for (;;) {
taia_now(&stamp);
- taia_uint(&deadline,120);
- taia_add(&deadline,&deadline,&stamp);
- dns_transmit_io(&dns_resolve_tx,x,&deadline);
- iopause(x,1,&deadline,&stamp);
- r = dns_transmit_get(&dns_resolve_tx,x,&stamp);
+ taia_uint(&deadline, 120);
+ taia_add(&deadline, &deadline, &stamp);
+ dns_transmit_io(&dns_resolve_tx, x, &deadline);
+ iopause(x, 1, &deadline, &stamp);
+ r = dns_transmit_get(&dns_resolve_tx, x, &stamp);
if (r < 0) return DNS_COM;
if (r == 1) return 0;
}