summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b827d58)
raw | patch | inline | side by side (parent: b827d58)
author | Florian Forster <octo@verplant.org> | |
Mon, 12 Jun 2006 20:46:08 +0000 (22:46 +0200) | ||
committer | Florian Forster <octo@verplant.org> | |
Mon, 12 Jun 2006 20:46:08 +0000 (22:46 +0200) |
In >90% of all cases you will pass an IP-address to that option anyway. After
the address has been looked up, set `obj->addrfamily' accordingly.
the address has been looked up, set `obj->addrfamily' accordingly.
src/liboping.c | patch | blob | history |
diff --git a/src/liboping.c b/src/liboping.c
index d74659fd24df0a9a7d48dd3763d2cdb2878a303c..9fad0c2dc09dbabf353a1fa9f28772c72ce28d6f 100644 (file)
--- a/src/liboping.c
+++ b/src/liboping.c
struct addrinfo ai_hints;
struct addrinfo *ai_list;
int status;
-
+#if WITH_DEBUG
+ if (obj->addrfamily != AF_UNSPEC)
+ {
+ dprintf ("Resetting obj->addrfamily to AF_UNSPEC.\n");
+ }
+#endif
memset ((void *) &ai_hints, '\0', sizeof (ai_hints));
- ai_hints.ai_family = obj->addrfamily;
+ ai_hints.ai_family = obj->addrfamily = AF_UNSPEC;
#if defined(AI_ADDRCONFIG)
ai_hints.ai_flags = AI_ADDRCONFIG;
#endif
memcpy ((void *) obj->srcaddr, (const void *) ai_list->ai_addr,
ai_list->ai_addrlen);
obj->srcaddrlen = ai_list->ai_addrlen;
+ obj->addrfamily = ai_list->ai_family;
freeaddrinfo (ai_list);
} /* case PING_OPT_SOURCE */