diff options
| author | Přemysl Janouch <p.janouch@gmail.com> | 2014-09-26 20:49:55 +0200 | 
|---|---|---|
| committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-09-26 21:32:16 +0200 | 
| commit | 31bb98c995e84f1d2174d9e68e95145bc78a5eba (patch) | |
| tree | a548cf9ce563772a0e47be5ddebed96a6ff856de | |
| parent | fcf21ca4cf2840f03f1294eb79c4489d908b2455 (diff) | |
| download | ponymap-31bb98c995e84f1d2174d9e68e95145bc78a5eba.tar.gz ponymap-31bb98c995e84f1d2174d9e68e95145bc78a5eba.tar.xz ponymap-31bb98c995e84f1d2174d9e68e95145bc78a5eba.zip | |
The targets are not always hostnames
If a target specified on the command line equals its IP address string,
don't put the string as a hostname in the results.
| -rw-r--r-- | ponymap.c | 6 | 
1 files changed, 4 insertions, 2 deletions
| @@ -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); | 
