From: Wouter Wijngaards Date: Fri, 16 May 2008 11:35:00 +0000 (+0000) Subject: hosts file fixup for MacOSX X-Git-Tag: release-1.0.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e60174a0000530f6e9756bebf6daceff54c06a58;p=thirdparty%2Funbound.git hosts file fixup for MacOSX git-svn-id: file:///svn/unbound/trunk@1083 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 344c34b8c..5dc762076 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +16 May 2008: Wouter + - fixup for MacOSX hosts file reading (reported by John Dickinson). + 14 May 2008: Wouter - accepted patch from Ondrej Sury for library version libtool option. - configure --disable-rpath fixes up libtool for rpath trouble. diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index 3c5134c7f..8ba1e91aa 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -889,6 +889,8 @@ ub_ctx_hosts(struct ub_ctx* ctx, char* fname) parse++; if(*parse == '\n' || *parse == 0) continue; + if(*parse == '%') + continue; /* ignore macOSX fe80::1%lo0 localhost */ if(*parse != ' ' && *parse != '\t') { /* must have whitespace after address */ fclose(in); diff --git a/testdata/hostsfileosx.tpkg b/testdata/hostsfileosx.tpkg new file mode 100644 index 000000000..e12de40bb Binary files /dev/null and b/testdata/hostsfileosx.tpkg differ