]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
hosts file fixup for MacOSX
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 May 2008 11:35:00 +0000 (11:35 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 May 2008 11:35:00 +0000 (11:35 +0000)
git-svn-id: file:///svn/unbound/trunk@1083 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
libunbound/libunbound.c
testdata/hostsfileosx.tpkg [new file with mode: 0644]

index 344c34b8c19b1728a26ae7cc37fe15f10134413d..5dc762076ee21c306eb3d5ce343b6eee550f46c7 100644 (file)
@@ -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.
index 3c5134c7f305625709751bc233dca26537d3218c..8ba1e91aa90a7e68fb7309cb9c1f95b14de09885 100644 (file)
@@ -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 (file)
index 0000000..e12de40
Binary files /dev/null and b/testdata/hostsfileosx.tpkg differ