summaryrefslogtreecommitdiff
path: root/ponymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'ponymap.c')
-rw-r--r--ponymap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ponymap.c b/ponymap.c
index 54b0e75..e11c559 100644
--- a/ponymap.c
+++ b/ponymap.c
@@ -1505,8 +1505,6 @@ generator_make_target (struct app_context *ctx)
target->ref_count = 1;
target->ctx = ctx;
target->ip = g->ip_iter;
- if (g->ip_iter == g->ip_range_iter->original_address)
- target->hostname = xstrdup (g->ip_range_iter->original_name);
uint32_t address = htonl (target->ip);
if (!inet_ntop (AF_INET, &address,
@@ -1516,6 +1514,10 @@ generator_make_target (struct app_context *ctx)
*target->ip_string = '\0';
}
+ if (g->ip_iter == g->ip_range_iter->original_address
+ && strcmp (target->ip_string, g->ip_range_iter->original_name))
+ target->hostname = xstrdup (g->ip_range_iter->original_name);
+
LIST_APPEND_WITH_TAIL (ctx->running_targets, ctx->running_tail, target);
target_update_indicator (ctx->running_targets);