aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-11-22 13:27:26 +0100
committerMarvin Borner2020-11-22 13:27:26 +0100
commit9b739062e9e0a10770d5f6c11d65649671031374 (patch)
treeb53f6927576f4b8f41737b54726099ae2d6ae359
parent11568b08115cd0a7fe17608599abdc8a80a4ec50 (diff)
Fixed DNS with one part
-rw-r--r--libnet/dns.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libnet/dns.c b/libnet/dns.c
index 5fe9411..fe57cc4 100644
--- a/libnet/dns.c
+++ b/libnet/dns.c
@@ -96,7 +96,7 @@ static u32 dns_handle_packet(struct dns_packet *packet)
u32 dns_request(const char *name)
{
struct socket *socket = net_open(S_UDP);
- if (!socket || !net_connect(socket, dns_ip_addr, 53))
+ if (!socket || !net_connect(socket, dns_ip_addr, 53) || part_count(name) == 1)
return 0;
u32 length = sizeof(struct dns_packet) + strlen(name) + part_count(name) + 4;