#include <libdill.h>
#include <stdio.h>
int main() {
struct ipaddr addr;
int rc = ipaddr_remote(&addr, "example.org", 80, 0, -1);
if (rc != 0) {
printf("rc=%i,errno=%i\n",rc,errno);
return 1;
}
return 0;
}
Sometimes prints rc=-1,errno=99 (not a valid errno), sometimes segfaults straight away. If you swap "example.org" for "127.0.0.1" it works just fine. From grepping tests/ for ipaddr_remote it seems it's only tested for 0.0.0.0 and 127.0.0.1 and not domain names.
Adaptation from the tutorial:
Sometimes prints
rc=-1,errno=99
(not a valid errno), sometimes segfaults straight away. If you swap "example.org" for "127.0.0.1" it works just fine. Fromgrep
ping tests/ foripaddr_remote
it seems it's only tested for0.0.0.0
and127.0.0.1
and not domain names.