mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
authd: fix some DNS module logic
This commit is contained in:
parent
5164a68650
commit
fa43f55940
1 changed files with 6 additions and 5 deletions
11
authd/dns.c
11
authd/dns.c
|
@ -116,16 +116,14 @@ resolve_dns(int parc, char *parv[])
|
||||||
{
|
{
|
||||||
case '4':
|
case '4':
|
||||||
type = T_A;
|
type = T_A;
|
||||||
if(!rb_inet_pton_sock(rec, (struct sockaddr *) &req->addr))
|
|
||||||
exit(6);
|
|
||||||
break;
|
break;
|
||||||
case '6':
|
case '6':
|
||||||
type = T_AAAA;
|
type = T_AAAA;
|
||||||
if(!rb_inet_pton_sock(rec, (struct sockaddr *) &req->addr))
|
|
||||||
exit(6);
|
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
case 'S':
|
case 'S':
|
||||||
|
if(!rb_inet_pton_sock(rec, (struct sockaddr *) &req->addr))
|
||||||
|
exit(6);
|
||||||
type = T_PTR;
|
type = T_PTR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -133,5 +131,8 @@ resolve_dns(int parc, char *parv[])
|
||||||
req->query.ptr = req;
|
req->query.ptr = req;
|
||||||
req->query.callback = submit_dns_answer;
|
req->query.callback = submit_dns_answer;
|
||||||
|
|
||||||
gethost_byname_type(rec, &req->query, type);
|
if (type != T_PTR)
|
||||||
|
gethost_byname_type(rec, &req->query, type);
|
||||||
|
else
|
||||||
|
gethost_byaddr(&req->addr, &req->query);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue