From c72ecdba04e7e9c3a411daaeb6fabab85314f82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Thu, 10 Feb 2022 00:18:54 +0100 Subject: not important --- README | 6 ++++++ host.c | 2 ++ main.c | 6 +++--- 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 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) { -- cgit v1.2.3