Hello Robert!
Today i debugged 20-dns.conf script and found the problem.
It's a content of 20-dns.conf script, i included some debug messages:
set_dns_props()
{
echo "executing SET_DNS_PROPS"
case "${new_domain_name_servers}" in
"") return 0;;
esac
echo "AFTER 1"
count=1
for i in 1 2 3 4; do
setprop dhcp.${interface}.dns${i} ""
done
echo "AFTER 2"
count=1
for dnsaddr in ${new_domain_name_servers}; do
setprop dhcp.${interface}.dns${count} ${dnsaddr}
echo "MAXXXXXXX"
echo ${dnsaddr}
count=$(($count + 1))
done
}
I don't see message "AFTER 1", which means that variable
new_domain_name_servers = "" (Empty).
But i don't know why. Is dhcpcd fill this variable
new_domain_name_servers?
my system properties:
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=MASTER
ro.build.display.id=MASTER.eng.root.20100517.205514
ro.build.version.incremental=eng.root.20100517.205514
ro.build.version.sdk=5
ro.build.version.codename=AOSP
ro.build.version.release=AOSP
ro.build.date=Mon May 17 20:56:02 EEST 2010
ro.build.date.utc=1274118962
ro.build.type=user
ro.build.user=root
ro.build.host=haha
ro.build.tags=test-keys
ro.product.model=AOSP on Pegasus (US, RU)
ro.product.brand=pegasus
ro.product.name=pegasus
ro.product.device=pegasus
ro.product.board=
ro.product.cpu.abi=armeabi
ro.product.manufacturer=mgr
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=pegasus
# ro.build.product is obsolete; use ro.product.device
ro.build.product=pegasus
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=pegasus-user AOSP MASTER eng.root.20100517.205514
test-keys
ro.build.fingerprint=pegasus/pegasus/pegasus/:AOSP/MASTER/eng.root.
20100517.205514:user/test-keys
# end build properties
#
# system.prop for Pegasus
#
#rild.libpath=/system/lib/libhtc_ril.so
wifi.interface=wlan0
# Time between scans in seconds. Keep it high to minimize battery
drain.
# This only affects the case in which there are remembered access
points,
# but none are in range.
wifi.supplicant_scan_interval = 45
# density in DPI of the LCD of this board. This is used to scale the
UI
# appropriately. If this property is not defined, the default value is
160 dpi..
ro.sf.lcd_density = 128
# Default network type
# 0 => WCDMA Preferred.
#ro.telephony.default_network = 0
#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.config.notification_sound=OnTheHunt.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
net.bt.name=Android
ro.config.sync=yes
dalvik.vm.stack-trace-file=/data/anr/traces.txt
On May 17, 11:27 pm, Robert Greenwalt <[email protected]> wrote:
> Your WifiStateTracker reports:
>
> V/WifiStateTracker( 1731): IP configuration: ipaddr 192.168.1.101
> gateway 192.168.1.1 netmask 255.255.255.0 dns1 0.0.0.0 dns2 0.0.0.0
> DHCP server 192.168.1.1 lease 7200 seconds
>
> so the mDhcpInfo object seems to not know what's up regarding dns. Can you
> include the system properties to your log (or use "adb bugreport > foo")?
>
> R
>
> On Mon, May 17, 2010 at 12:56 PM, supermaximus79
> <[email protected]>wrote:
>
> > Thanks!
>
> > I verified in WifiStateTracker constructor interfaces names, here they
> > are:
> > DNS1 = dhcp.wlan0.dns1
> > DNS2 = dhcp.wlan0.dns2
> > Looks like everything is ok
>
> > But still there is empty DNS.
> > My logs:
>
> > init: starting
> > 'wpa_supplicant'
> > D/WifiService( 1731): ACTION_BATTERY_CHANGED pluggedType:
> > 1
> > E/WifiHW ( 1731): Unable to open connection to supplicant on "wlan0":
> > No such file or
> > directory
> > D/SettingsWifiEnabler( 1967): Received wifi state changed from
> > Enabling to
> > Enabled
> > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=-1
> > state=2
> > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > Ready
> > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > Ready
> > E/SettingsWifiLayer( 1967): Unable to scan for
> > networks
> > I/NotificationService( 1731): enqueueToast pkg=com.android.settings
> > callback=android.app.itransientnotification$stub$pr...@438e6b28
> > duration=1
> > ioctl[SIOCSIWPRIV]: Operation not
> > permitted
> > E/wpa_supplicant( 2386): wpa_driver_priv_driver_cmd
> > failed
> > V/WifiStateTracker( 1731): Connection to supplicant established,
> > state=SCANNING
> > D/NetworkStateTracker( 1731): setDetailed state, old =DISCONNECTED and
> > new
> > state=SCANNING
> > D/ConnectivityService( 1731): ConnectivityChange for WIFI:
> > DISCONNECTED/
> > SCANNING
> > D/DataConnectionTracker( 1841): enableApnType(default),
> > isApnTypeActive = false and state =
> > IDLE
> > ioctl[SIOCSIWPRIV]: Operation not
> > permitted
> > E/wpa_supplicant( 2386): wpa_driver_priv_driver_cmd
> > failed
> > I/ActivityManager( 1731): Start proc android.process.media for
> > broadcast com.android.providers.downloads/.DownloadReceiver: pid=2389
> > uid=10010 gids={1006, 1015, 2001, 3003}
> > I/dalvikvm( 2389): Debugger thread not active, ignoring DDM send
> > (t=0x41504e4d
> > l=38)
> > I/dalvikvm( 2389): Debugger thread not active, ignoring DDM send
> > (t=0x41504e4d
> > l=46)
> > I/ActivityThread( 2389): Publishing provider drm:
> > com.android.providers.drm.DrmProvider
> > I/ActivityThread( 2389): Publishing provider media:
> > com.android.providers.media.MediaProvider
> > V/MediaProvider( 2389): Attached volume:
> > internal
> > I/ActivityThread( 2389): Publishing provider downloads:
> > com.android.providers.downloads.DownloadProvider
> > I/ActivityManager( 1731): Exiting empty application process
> > android.process.media
> > (android.os.binderpr...@437fed50)
> > I/Process ( 1731): Sending signal. PID: 2389 SIG:
> > 9
> > D/ActivityManager( 1731): Received spurious death notification for
> > thread
> > android.os.binderpr...@437fed50
> > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > Ready
> > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > Ready
> > E/SettingsWifiLayer( 1967): Could not set highest priority on state
> > because saving config
> > failed.
> > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > Ready
> > I/wpa_supplicant( 2386): Trying to associate with 00:27:19:18:36:a2
> > (SSID='11g' freq=2437
> > MHz)
> > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=-1
> > state=3
> > I/wpa_supplicant( 2386): Association request to the driver
> > failed
> > V/WifiMonitor( 1731): Event [Trying to associate with
> > 00:27:19:18:36:a2 (SSID='11g' freq=2437
> > MHz)]
> > V/WifiMonitor( 1731): Event [CTRL-EVENT-STATE-CHANGE id=-1
> > state=3]
> > V/WifiStateTracker( 1731): Changing supplicant state: SCANNING ==>
> > ASSOCIATING
> > D/NetworkStateTracker( 1731): setDetailed state, old =SCANNING and new
> > state=CONNECTING
> > D/ConnectivityService( 1731): ConnectivityChange for WIFI: CONNECTING/
> > CONNECTING
> > V/WifiMonitor( 1731): Event [Association request to the driver
> > failed]
> > D/dalvikvm( 1731): GC freed 13858 objects / 699376 bytes in
> > 234ms
> > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=0
> > state=4
> > I/wpa_supplicant( 2386): Associated with
> > 00:27:19:18:36:a2
> > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=0
> > state=7
> > I/wpa_supplicant( 2386): CTRL-EVENT-CONNECTED - Connection to
> > 00:27:19:18:36:a2 completed (auth) [id=0
> > id_str=]
> > V/WifiMonitor( 1731): Event [CTRL-EVENT-STATE-CHANGE id=0
> > state=4]
> > V/WifiStateTracker( 1731): Changing supplicant state: ASSOCIATING ==>
> > ASSOCIATED
> > D/NetworkStateTracker( 1731): setDetailed state, old =CONNECTING and
> > new
> > state=CONNECTING
> > V/WifiMonitor( 1731): Event [Associated with
> > 00:27:19:18:36:a2]
> > V/WifiMonitor( 1731): Event [CTRL-EVENT-STATE-CHANGE id=0
> > state=7]
> > V/WifiStateTracker( 1731): Changing supplicant state: ASSOCIATED ==>
> > COMPLETED
> > V/WifiMonitor( 1731): Event [CTRL-EVENT-CONNECTED - Connection to
> > 00:27:19:18:36:a2 completed (auth) [id=0
> > id_str=]]
> > V/WifiStateTracker( 17init: starting
> > 'dhcpcd'
> > 31): New network state is
> > CONNECTED
> > D/NetworkStateTracker( 1731): setDetailed state, old =CONNECTING and
> > new
> > state=OBTAINING_IPADDR
> > D/WifiStateTracker( 1731): DhcpHandler: DHCP request
> > started
> > D/ConnectivityService( 1731): ConnectivityChange for WIFI: CONNECTING/
> > OBTAINING_IPADDR
> > D/SettingsWifiEnabler( 1967): Received network state changed to
> > NetworkInfo: type: WIFI[], state: CONNECTING/OBTAINING_IPADDR, reason:
> > (unspecified), extra: (none), roaming: falsee
> > wlan0: dhcpcd 4.0.1
> > starting
> > wlan0: hardware address =
> > 00:21:e8:89:39:28
> > wlan0: executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason
> > PREINIT
> > wlan0: host does not support a monotonic clock - timing can
> > skew
> > wlan0: broadcasting for a
> > lease
> > wlan0: sending DHCP_DISCOVER with xid 0x8ad51535, next in 4.61
> > seconds
> > wlan0: offered 192.168.1.101 from 192.168.1.1
> > `ÿ'
> > wlan0: checking 192.168.1.101 is available on attached
> > networks
> > wlan0: sending ARP probe (1 of 3), next in 1.29
> > seconds
> > wlan0: sending ARP probe (2 of 3), next in 1.85
> > seconds
> > wlan0: sending ARP probe (3 of 3), next in 2.00
> > seconds
> > wlan0: sending DHCP_REQUEST with xid 0x8ad51535, next in 4.69
> > seconds
> > wlan0: acknowledged 192.168.1.101 from 192.168.1.1
> > `ÿ'
> > wlan0: leased 192.168.1.101 for 7200
> > seconds
> > wlan0: adding IP address
> > 192.168.1.101/24
> > wlan0: adding route to 0.0.0.0/0 via
> > 192.168.1.1
> > wlan0: executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason
> > BOUND
> > wlan0: forking to
> > background
> > init: waitpid returned pid 2395, status =
> > 00000000
> > init: process 'dhcpcd', pid 2395
> > exited
> > V/WifiStateTracker( 1731): DhcpHandler: DHCP request succeeded
> > D/NetworkStateTracker( 1731): setDetailed state, old =OBTAINING_IPADDR
> > and new state=CONNECTED
> > V/WifiStateTracker( 1731): IP configuration: ipaddr 192.168.1.101
> > gateway 192.168.1.1 netmask 255.255.255.0 dns1 0.0.0.0 dns2 0.0.0.0
> > DHCP server 192.168.1.1 lease 7200 seconds
> > D/ConnectivityService( 1731): ConnectivityChange for WIFI: CONNECTED/
> > CONNECTED
> > V/NetworkStateTracker( 1731): Setting TCP values:
> > [4095,87380,110208,4096,16384,110208] which comes from
> > [net.tcp.buffersize.wifi]
> > E/NetworkStateTracker( 1731): Can't set tcp buffer
> > sizes:java.io.FileNotFoundException: /sys/kernel/ipv4/tcp_rmem_min
>
> > On May 17, 8:28 pm, Robert Greenwalt <[email protected]> wrote:
> > > the net.dns1 property is set by the ConnectivityService when it switches
> > > networks. The WifiStateTracker is supposed to give the
> > ConnectivityService
> > > a list of properties it uses to store dns values and then the CS will
> > copy
> > > them when appropriate.
>
> > > You should verify that your WifiStateTracker is telling
> > connectivityservice
> > > your dhcp.wlan0.dns1, dns2, etc properties (see the WifiStateTracker
> > > constructor - it uses the system property "wifi.interface" to specify the
> > > interface name and constructs "dhcp.<iface>.dns1" for you).
>
> > > Next you have to make sure that the ConnectivityService thinks wifi is
> > the
> > > active network and is trying to copy your dns entries. This should be
> > > obvious from the logs.
>
> > > R
>
> > > On Mon, May 17, 2010 at 10:19 AM, supermaximus79 <[email protected]
> > >wrote:
>
> > > > I have found what the problem with!
>
> > > > DHCPCD calls script dhcp-run-hooks, which also calls 20-dns.conf
> > > > script.
> > > > 20-dns.conf script set DNS property this way:
>
> > > > setprop dhcp.${interface}.dns${count} ${dnsaddr}
>
> > > > in my case it will be:
> > > > setprop dhcp.wlan0.dns1 77.120.130.20 - but this doesn't work in
> > > > Android 2.1 Eclair my version.
>
> > > > I don't know why, but works only setprop net.dns1 77.120.130.20.
>
> > > > Could you tell, is this happens only in my version of Android, or all
> > > > Eclair and later versions have the same bug?
> > > > Is it possible to fix it, to make command: setprop dhcp.wlan0.dns1
> > > > dnsaddr working?
>
> > > > Thanks
>
> > > > On May 17, 4:05 pm, Максим Андрущенко <[email protected]> wrote:
> > > > > Hi.
> > > > > There is a problem on my platform during starting wifi. DNS is always
> > > > 0.0.0.0.
> > > > > I use dhcpcd for getting ip address, gateway, dns.
> > > > > DHCPCD gets correct IP address and gateway, but dns is zero.
> > > > > So i can type in browser ip address of a site and open it. But not
> > name,
> > > > suchwww.google.com.
>
> > > > > Here is log messages on my platform:
>
> > > > > V/WifiMonitor(init: starting 'dhcpcd'
> > > > > 1732): Event [Associated with 00:27:19:18:36:a2]
>
> > > > > V/WifiMonitor( 1732): Event [CTRL-EVENT-STATE-CHANGE id=0 state=7]
> > > > > V/WifiStateTracker( 1732): Changing supplicant state: ASSOCIATING ==>
>
> ...
>
> read more »
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting