summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-02-10 00:18:54 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2022-02-10 00:18:54 +0100
commitc72ecdba04e7e9c3a411daaeb6fabab85314f82a (patch)
treeb2da84878e80c7ce83fc318a2ce70ddbcf73fcfb
parent0.0.3 (diff)
downloaddnsfind-c72ecdba04e7e9c3a411daaeb6fabab85314f82a.tar
dnsfind-c72ecdba04e7e9c3a411daaeb6fabab85314f82a.tar.gz
dnsfind-c72ecdba04e7e9c3a411daaeb6fabab85314f82a.tar.bz2
dnsfind-c72ecdba04e7e9c3a411daaeb6fabab85314f82a.tar.lz
dnsfind-c72ecdba04e7e9c3a411daaeb6fabab85314f82a.tar.xz
dnsfind-c72ecdba04e7e9c3a411daaeb6fabab85314f82a.tar.zst
dnsfind-c72ecdba04e7e9c3a411daaeb6fabab85314f82a.zip
-rw-r--r--README6
-rw-r--r--host.c2
-rw-r--r--main.c6
3 files changed, 11 insertions, 3 deletions
diff --git a/README b/README
index be6a12a..0c3bf16 100644
--- a/README
+++ b/README
@@ -49,4 +49,10 @@ avtomatska gradnja izvršilnih datotek in programskih paketov za štiri arhitekt
http://armel.sijanec.eu/prog/dnsfind
i386 pa gradi moj osebni prenosni računalnik, ki ni vedno povezan v Internet.
+možne napake:
+ EINVAL na sendto(2): verjetno je bil paket poslan na lokalno mrežo, vendar je ARP tabela
+ polna. povečajte arp tabelo ali pošljite vse pakete na gateway.
+ https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
+ sysctl -a | grep -i ipv4.*default.gc.thresh
+
-- Anton Luka Šijanec <anton@sijanec.eu> Tue, 19 Jan 2022 14:30:00 +0200
diff --git a/host.c b/host.c
index 9fc2cad..7012876 100644
--- a/host.c
+++ b/host.c
@@ -47,6 +47,8 @@ int resolve (const char * d, uint32_t * r) {
};
struct addrinfo * result;
int ret = getaddrinfo(d, NULL, &hints, &result);
+ if (ret)
+ return ret;
*r = ((struct sockaddr_in *) result->ai_addr)->sin_addr.s_addr; /* ah yes, C */
freeaddrinfo(result);
return ret;
diff --git a/main.c b/main.c
index bdcc30b..a7b2ba4 100644
--- a/main.c
+++ b/main.c
@@ -583,11 +583,11 @@ finished_sending:
r = 17;
goto r;
}
- if (sendto(s, u, L, 0, (struct sockaddr *) &m, sizeof(struct sockaddr)) == -1) {
- perror("sendto(s,u, L, 0, (struct sockaddr *) &m, sizeof(struct sockaddr))");
+ if (sendto(s, u, L, 0, (struct sockaddr *) &m, sizeof(struct sockaddr_in)) == -1) {
+ perror("sendto(s, u, L, 0, (struct sockaddr *) &m, sizeof(struct sockad...");
r = 18;
goto r;
- }
+ } /* https://stevecao.wordpress.com/2018/09/28/diagnosing-invalid-argument-error */
struct timespec z;
i:
if (clock_gettime(CLOCK_MONOTONIC, &z) == -1) {