View Single Post
Posts: 152 | Thanked: 41 times | Joined on Dec 2009 @ Sydney
#56
I had a wifi problem too. I thought it was just me and concluded I must have edited /etc/dnsmasq.conf and thus the upgrade didn't overwrite that file cause it had changed, but I needed the changes it seems.

http://talk.maemo.org/showthread.php?t=40425

In a nut shell.

The N900 uses dnsmasq [why a small devices uses a DNS/DHCP server designed for servers is beyond me]
And in it's config it lists it's resolv files it uses to look up DNS servers.

So with that, let's see what dnsmasq wants to look up

Code:
Nokia-N900-42-11:~# grep resolv /etc/dnsmasq.conf
# somewhere other that /etc/resolv.conf
resolv-file=/var/run/resolv.conf
resolv-file=/tmp/resolv.conf.wlan0
resolv-file=/tmp/resolv.conf.ppp0
resolv-file=/tmp/resolv.conf.lo
resolv-file=/tmp/resolv.conf.gprs
# /etc/resolv.conf
# If you don't want dnsmasq to read /etc/resolv.conf or any other
#no-resolv
# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv\
Right cool. I know from experience, before the update that the /tmp/resolv* files were created when a connection was made. So let's have a look at those files, they should list an IP of your DNS server.


Code:
Nokia-N900-42-11:~# cat /tmp/resolv*
cat: can't open '/tmp/resolv*': No such file or directory.
Hmmmm that is odd, the update has changed things...

Let's try the other file, it must using that now....

Code:
Nokia-N900-42-11:~# cat /var/run/resolv.conf
cat: can't open '/var/run/resolv.conf': No such file or directory.

Oh dear. We have a problem Houston.

Code:
Nokia-N900-42-11:~# ls /var/run/resolv*
/var/run/resolv.conf.wlan0
Hmmmm bugger.

Ok to fix this we need to tell dnsmasq about this.
Change the below in /etc/dnsmasq.conf from:

Code:
# somewhere other that /etc/resolv.conf
resolv-file=/var/run/resolv.conf
resolv-file=/tmp/resolv.conf.wlan0
resolv-file=/tmp/resolv.conf.ppp0
resolv-file=/tmp/resolv.conf.lo
resolv-file=/tmp/resolv.conf.gprs
To:

Code:
# somewhere other that /etc/resolv.conf
resolv-file=/var/run/resolv.conf
resolv-file=/var/run/resolv.conf.wlan0
resolv-file=/var/run/resolv.conf.ppp0
resolv-file=/var/run/resolv.conf.lo
resolv-file=/var/run/resolv.conf.gprs
resolv-file=/tmp/resolv.conf.wlan0
resolv-file=/tmp/resolv.conf.ppp0
resolv-file=/tmp/resolv.conf.lo
resolv-file=/tmp/resolv.conf.gprs
And restart dnsmasq

Code:
/etc/init.d/dnsmasq restart
Now it all should be working.
You are done. For anyone curious more about this.....



I dug around and found the culprit.

I first checked the dhcp client.

Code:
Nokia-N900-42-11:~#grep var  /etc/udhcpc/*
/etc/udhcpc/default.bound:RESOLV_CONF="/var/run/resolv.conf"
/etc/udhcpc/default.renew:RESOLV_CONF="/var/run/resolv.conf"
Hmm mthat looks right.

Digging further into it configs dir I found:

Code:
/etc/udhcpc/libcd_network_ipv4.script
Which references /etc/maemo-dhcp.d/


Code:
Nokia-N900-42-11:~# grep -i resolv /etc/maemo-dhcp.d/50_ipv4_network_setup
RESOLV_CONF="/var/run/resolv.conf.$interface"
          if egrep "^nameserver[\t ]*${ns}" $RESOLV_CONF > /dev/null
              echo -n > $RESOLV_CONF.tmp
              [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF.tmp
                echo nameserver $i >> $RESOLV_CONF.tmp
              mv $RESOLV_CONF.tmp $RESOLV_CONF


This is the issue:
Code:
RESOLV_CONF="/var/run/resolv.conf.$interface"
Had it been:

Code:
RESOLV_CONF="/var/run/resolv.conf"
We would be fine, but then concurrent connections may argue over the same file and corrupt it.

So where does this come from:

Code:
Nokia-N900-42-11:~# dpkg -S /etc/maemo-dhcp.d/50_ipv4_network_setup
libicd-network-ipv4: /etc/maemo-dhcp.d/50_ipv4_network_setup
Which looking at its description is a core package for the udhcp client.
 

The Following 3 Users Say Thank You to DaveQB For This Useful Post: