diff options
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | host.c | 2 | ||||
-rw-r--r-- | main.c | 6 |
3 files changed, 11 insertions, 3 deletions
@@ -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 @@ -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; @@ -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) { |