Commit Graph

7 Commits (master)

Author SHA1 Message Date
rofl0r 452830283c move isnumericipv4() to common.c 2020-10-28 10:39:27 +00:00
rofl0r 1e00b9ac1e get rid of ip_type.c 2020-09-23 17:00:16 +01:00
rofl0r a1c31e73b6 improve hostsreader test code 2016-02-04 09:38:16 +00:00
Alexander Batischev f85cecdabe Fix bug in hostsreader
hostsreader_get() used to assign the IP address to both `name` and `ip`
fields in `struct hostsreader`, which led to proxychains effectively
ignoring the contents of /etc/hosts.
2016-02-04 09:37:06 +00:00
rofl0r 2237749567 preliminary ipv6 support
only basic testing was done (with 2 socks5 proxies listening on ::1)
but seems to work as intended.

ipv6 support for the hostsreader (/etc/hosts) is not implemented so far.
2015-08-10 17:00:26 +01:00
rofl0r 25ee4c318d hostsreader: use temporary vars for string manipulation
working directly with the passed variables could lead to bugs when
some lines in the hosts file aren't well-formed and the loop is taken
several times while the buf vars are already modified.
2014-11-14 13:19:06 +01:00
rofl0r 4fb7eb0532 replace problematic hostentdb with hostsreader
the hostentdb introduced between 4.2 and 4.3
(via af5c6f0c6a )
had several issues:
- it caused breakage on FreeBSD and was commented out there
- prevented usage of the hostdb when proxy_dns was turned off
  (issue #42)
- required dynamic memory allocation which was accessed from several
  threads
- wouldnt reflect changes to the hosts file made during program run

the only sensible solution is to remove the hostentdb and replace it
with a home-grown hosts parser (we can't use gethostent() since
that would mess up the gethostent()-state from different threads).

the new parser used here is deliberately held simple and only meant
to provide the user with means to reference hardcoded ipv4 addresses
via his hosts file.

fixes #42
2014-11-14 12:33:58 +01:00