Here's a patch to enable not using the DHCP server assigned DNS servers via a UCI option.
Signed-off-by: Brian J. Murrell <[EMAIL PROTECTED]> Index: package/base-files/files/usr/share/udhcpc/default.script =================================================================== --- package/base-files/files/usr/share/udhcpc/default.script (revision 11518) +++ package/base-files/files/usr/share/udhcpc/default.script (working copy) @@ -14,6 +14,18 @@ config_get proto $ifc proto [ "$proto" = "dhcp" ] || continue [ ifup = "$1" ] && { + config_get_bool nousepeerdns "$ifc" nousepeerdns 0 + [ "$nousepeerdns" -eq 0 ] && { + [ -n "$dns" ] && { + echo -n > "${RESOLV_CONF}.tmp" + ${domain:+echo search $domain} >> "${RESOLV_CONF}.tmp" + for i in $dns ; do + echo "adding dns $i" + echo "nameserver $i" >> "${RESOLV_CONF}.tmp" + done + mv "${RESOLV_CONF}.tmp" "$RESOLV_CONF" + } + } uci_set_state network "$ifc" ipaddr "$ip" uci_set_state network "$ifc" netmask "${subnet:-255.255.255.0}" uci_set_state network "$ifc" dnsdomain "$domain" @@ -46,16 +58,6 @@ $(route -n | awk '/^0.0.0.0\W{9}('$valid')\W/ {next} /^0.0.0.0/ {print "route del -net "$1" gw "$2";"}') } - [ -n "$dns" ] && { - echo -n > "${RESOLV_CONF}.tmp" - ${domain:+echo search $domain} >> "${RESOLV_CONF}.tmp" - for i in $dns ; do - echo "adding dns $i" - echo "nameserver $i" >> "${RESOLV_CONF}.tmp" - done - mv "${RESOLV_CONF}.tmp" "$RESOLV_CONF" - } - hotplug_event ifup # user rules
signature.asc
Description: This is a digitally signed message part
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel