Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/openresolv/dist Import openresolv-3.4.6 with th...



details:   https://anonhg.NetBSD.org/src/rev/ab844949d8ed
branches:  trunk
changeset: 773335:ab844949d8ed
user:      roy <roy%NetBSD.org@localhost>
date:      Tue Jan 31 09:19:58 2012 +0000

description:
Import openresolv-3.4.6 with the following change from 3.4.5
* dnsmasq subscriber correctly sets IPv6 domain specific servers over dbus

diffstat:

 external/bsd/openresolv/dist/dnsmasq.in |  46 +++++++++++++++++++++++++++-----
 1 files changed, 38 insertions(+), 8 deletions(-)

diffs (86 lines):

diff -r b25944ef9b8e -r ab844949d8ed external/bsd/openresolv/dist/dnsmasq.in
--- a/external/bsd/openresolv/dist/dnsmasq.in   Tue Jan 31 08:57:36 2012 +0000
+++ b/external/bsd/openresolv/dist/dnsmasq.in   Tue Jan 31 09:19:58 2012 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2011 Roy Marples
+# Copyright (c) 2007-2012 Roy Marples
 # All rights reserved
 
 # dnsmasq subscriber for resolvconf
@@ -58,8 +58,6 @@
                        kill -0 $(cat "$dnsmasq_pid") 2>/dev/null
                then
                        dbus=true
-                       newconf="$newconf$NL# Domain specific servers will"
-                       newconf="$newconf be sent over dbus${NL}enable-dbus$NL"
                fi
        fi
 fi
@@ -69,29 +67,61 @@
 done
 
 dbusdest=
+conf=
 for d in $DOMAINS; do
        dn="${d%%:*}"
        ns="${d#*:}"
        while [ -n "$ns" ]; do
-               if $dbus; then
+               case "$ns" in
+               *.*.*.*)
                        SIFS=${IFS-y} OIFS=$IFS
                        IFS=.
                        set -- ${ns%%,*}
                        num="0x$(printf %02x $1 $2 $3 $4)"
-                       if [ "$SIFS" = yi ]; then
+                       if [ "$SIFS" = y ]; then
                                unset IFS
                        else
                                IFS=$OIFS
                        fi
                        dbusdest="$dbusdest uint32:$(printf %u $num)"
                        dbusdest="$dbusdest string:$dn"
-               else
-                       newconf="${newconf}server=/$dn/${ns%%,*}$NL"
-               fi
+                       ;;
+               *:*:*:*:*:*:*:*)
+                       SIFS=${IFS-y} OIFS=$IFS bytes=
+                       IFS=:
+                       set -- ${ns%%,*}
+                       while [ -n "$1" ]; do
+                               addr="$1"
+                               shift
+                               while [ ${#addr} -lt 4 ]; do
+                                       addr="0${addr}"
+                               done
+                               byte1="$(printf %d 0x${addr%??})"
+                               byte2="$(printf %d 0x${addr#??})"
+                               dbusdest="$dbusdest byte:$byte1 byte:$byte2"
+                       done
+                       if [ "$SIFS" = y ]; then
+                               unset IFS
+                       else
+                               IFS=$OIFS
+                       fi
+                       dbusdest="$dbusdest string:$dn"
+                       ;;
+               *)
+                       dbus=false
+                       ;;
+               esac
+               conf="${conf}server=/$dn/${ns%%,*}$NL"
                [ "$ns" = "${ns#*,}" ] && break
                ns="${ns#*,}"
        done
 done
+if $dbus; then
+       newconf="$newconf$NL# Domain specific servers will"
+       newconf="$newconf be sent over dbus${NL}enable-dbus$NL"
+else
+       newconf="$newconf$conf"
+fi
 
 # Try to ensure that config dirs exist
 if type config_mkdirs >/dev/null 2>&1; then



Home | Main Index | Thread Index | Old Index