Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a few more protections if current name doesn't resolve anymore. #115

Closed
wants to merge 2 commits into from

Conversation

neilgierman
Copy link
Contributor

Looking at previous reports, if a name was no longer resolving either because the DNS entry was no longer there, or a temporary failure in DNS resolution, the current code would fail at the $address = inet_ntoa(inet_aton($param)); line. Added some logic that if the inet_aton returned nothing, then skip this entry and keep going.

@ghost ghost mentioned this pull request Jan 20, 2019
@ghost
Copy link

ghost commented Jan 21, 2019

Line 124 has this original problem....especially if $param happens to be empty

@neilgierman
Copy link
Contributor Author

Yes, but on Line 120, if $param is empty it immediately returns.

@ghost
Copy link

ghost commented Jan 21, 2019

`Create/Update database for config "/etc/awstats/awstats.site.conf" by AWStats version 7.7 (build 20180105)

From data in log file "/usr/local/awstats/tools/logresolvemerge.pl /var/log/apache2/log1.log /var/log/apache2/log2.log |"...

Bad arg length for Socket::inet_ntoa, length is 0, should be 4 at /usr/local/awstats/wwwroot/cgi-bin/plugins/geoip2.pm line 124, line 13483.

Phase 1 : First bypass old records, searching new record...

Searching new records from beginning of log file...

Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...`

manuelm added a commit to manuelm/awstats that referenced this pull request Apr 26, 2019
* Correctly convert dns names to ip4 and ip6 address using getaddrinfo
  (fixes eldy#120, eldy#121, obsoletes eldy#115)
* Only lookup if the IP is of type public (fixes eldy#122)
  and catch further lookup errors (obsoletes eldy#123)
* Store and display the GeoIP City output HTML escaped (fixes eldy#127)
* Code to perform and cache the actual lookup is consolidated
* General code improvement and readability
@eldy
Copy link
Owner

eldy commented Jun 27, 2019

Hope to have this fixed by #131

@eldy eldy closed this Jun 27, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants