Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/ROY]: src/external/bsd/openresolv/dist Import openresolv-3.5.1 to fix re...



details:   https://anonhg.NetBSD.org/src/rev/a9cadd34df3d
branches:  ROY
changeset: 454309:a9cadd34df3d
user:      roy <roy%NetBSD.org@localhost>
date:      Tue Mar 27 21:21:24 2012 +0000

description:
Import openresolv-3.5.1 to fix resolv_conf_local_only.

diffstat:

 external/bsd/openresolv/dist/libc.in |  21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r d3063471b9a8 -r a9cadd34df3d external/bsd/openresolv/dist/libc.in
--- a/external/bsd/openresolv/dist/libc.in      Mon Mar 26 14:41:33 2012 +0000
+++ b/external/bsd/openresolv/dist/libc.in      Tue Mar 27 21:21:24 2012 +0000
@@ -132,12 +132,21 @@
 *)
        [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
        newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)"
-       NS="$LOCALNAMESERVERS"
-       case "${resolv_conf_local_only:-1}" in
-       [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;;
-       *) NS="$NS $NAMESERVERS";;
-       esac
-       newns="$(uniqify $name_servers $NS $name_servers_append)"
+       NS="$LOCALNAMESERVERS $NAMESERVERS"
+       newns=
+       gotlocal=false
+       for n in $(uniqify $name_servers $NS $name_servers_append); do
+               add=true
+               case "$n" in
+               127.*|0.0.0.0|255.255.255.255|::1) gotlocal=true;;
+               *)
+                       case "${resolv_conf_local_only:-YES}" in
+                       [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+                               $gotlocal && add=false;;
+                       esac
+               esac
+               $add && newns="$newns $n"
+       done
 
        # Hold our new resolv.conf in a variable to save on temporary files
        newconf="# Generated by resolvconf$NL"



Home | Main Index | Thread Index | Old Index