Hi Chih-Wei

below is my init.rc

service wpa_supplicant /system/bin/wpa_supplicant -Dwext -ieth0 -c/
data/misc/wifi/wpa_supplicant.conf
    user root
    group system wifi inet
    disabled
    oneshot

service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -o
domain_name_servers -ABKL -d eth0
    disabled
    oneshot

    mkdir /data/misc/dhcp 0770 dhcp dhcp
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wifi/sockets/server 0770 wifi wifi
    mkdir /data/misc/wifi/sockets/clients 0770 wifi wifi
    mkdir /local/log 0777 system system
    symlink /opl/telephony/modules /opl/modules
# Added
    chown dhcp dhcp /data/misc/dhcp

but i dont see any changes in the output.

I ran "dhcpcd eth0" command from adb shell, server sending back proper
values.

Thanks
Gururaja B O


On Aug 12, 10:05 am, guru <[email protected]> wrote:
> HI  Chih-Wei/group
>
> I debugged the code in system/core/libnetutils/dhcp_utils.c
>
> it shows the except dsn1 and dsn2 other property is not set. So  I am
> seeing valid values for dsn1 and dsn2.
>
> P configuration: ipaddr 0.0.0.0 gateway 0.0.0.0 netmask 0.0.0.0 dns1
> 10.50.201.5 dns2 125.22.47.125 DHCP server 0.0.0.0 lease -1398609015
> seconds
>
> static void fill_ip_info(const char *interface,
>                      in_addr_t *ipaddr,
>                      in_addr_t *gateway,
>                      in_addr_t *mask,
>                      in_addr_t *dns1,
>                      in_addr_t *dns2,
>                      in_addr_t *server,
>                      uint32_t  *lease)
> {
>     char prop_name[PROPERTY_KEY_MAX];
>     char prop_value[PROPERTY_VALUE_MAX];
>     struct in_addr addr;
>     in_addr_t iaddr;
>
>     snprintf(prop_name, sizeof(prop_name), "%s.%s.ipaddress",
> DHCP_PROP_NAME_PREFIX, interface);
>     if (property_get(prop_name, prop_value, NULL) &&
> inet_aton(prop_value, &addr)) {
>         *ipaddr = addr.s_addr;
>     } else {
>         *ipaddr = 0;
>     }
>     snprintf(prop_name, sizeof(prop_name), "%s.%s.gateway",
> DHCP_PROP_NAME_PREFIX, interface);
>     if (property_get(prop_name, prop_value, NULL) &&
> inet_aton(prop_value, &addr)) {
>         *gateway = addr.s_addr;
>     } else {
>         *gateway = 0;
>     }
>     snprintf(prop_name, sizeof(prop_name), "%s.%s.mask",
> DHCP_PROP_NAME_PREFIX, interface);
>     if (property_get(prop_name, prop_value, NULL) &&
> inet_aton(prop_value, &addr)) {
>         *mask = addr.s_addr;
>     } else {
>         *mask = 0;
>     }
>     snprintf(prop_name, sizeof(prop_name), "%s.%s.dns1",
> DHCP_PROP_NAME_PREFIX, interface);
>     if (property_get(prop_name, prop_value, NULL) &&
> inet_aton(prop_value, &addr)) {
>         *dns1 = addr.s_addr;
>     } else {
>         *dns1 = 0;
>     }
>     snprintf(prop_name, sizeof(prop_name), "%s.%s.dns2",
> DHCP_PROP_NAME_PREFIX, interface);
>     if (property_get(prop_name, prop_value, NULL) &&
> inet_aton(prop_value, &addr)) {
>         *dns2 = addr.s_addr;
>     } else {
>         *dns2 = 0;
>     }
>     snprintf(prop_name, sizeof(prop_name), "%s.%s.server",
> DHCP_PROP_NAME_PREFIX, interface);
>     if (property_get(prop_name, prop_value, NULL) &&
> inet_aton(prop_value, &addr)) {
>         *server = addr.s_addr;
>     } else {
>         *server = 0;
>     }
>     snprintf(prop_name, sizeof(prop_name), "%s.%s.leasetime",
> DHCP_PROP_NAME_PREFIX, interface);
>     if (property_get(prop_name, prop_value, NULL)) {
>         *lease = atol(prop_value);
>     }
>
> }
>
> Who will set these property? Where I need to debug and whether I need
> to modify configuration information?
>
> Thanks
> Gururaja
>
> On Aug 6, 8:01 am, Chih-Wei <[email protected]> wrote:
>
> > This is my definition in init.rc:
>
> > service dhcpcd /system/bin/dhcpcd -o domain_name_servers -ABKL
> >     disabled
> >     oneshot
>
> > NOTE if you're using Froyo, you cannot add the interface (eth0).
> > But if you're using older version, eth0 is necessary.
>
> > If it still doesn't work, you need to capture the
> > packets replied from dhcp server to see what's wrong.
>
> > On 8月5日, 下午9時45分, guru <[email protected]> wrote:
>
> > > Hi Chih Wei
>
> > > Can you comment on my below mail! Just I need direction not exact
> > > solution.
>
> > > Thanks
> > > Gururaja B O
> > > On Aug 3, 1:34 pm, Chih-Wei <[email protected]> wrote:
>
> > > > The problem is, domain_name_servers is not
> > > > a default option in Android's dhcpcd.
> > > > I don't understand why.
>
> > > > Either modify external/dhcpcd, or add
> > > > domain_name_servers to your dhcpcd.conf,
> > > > or add -o domain_name_servers to your
> > > > dhcpcd command.
>
> > > > On 8月3日, 下午2時21分, guru <[email protected]> wrote:
>
> > > > > Hi All
>
> > > > > I am trying to enable wifi in froyo. I did some modification to the
> > > > > code base
>
> > > > > Now wifi is enabled and scanning. But it is not connecting
>
> > > > > logs shows that gateway dsn1 dsn2 server everything is zero.
>
> > > > > V/WifiStateTracker( 1020): IP configuration: ipaddr 10.50.200.236
> > > > > gateway 0.0.0.0 netmask 0.0.0.0 dns1 0.0.0.0 dns2 0.0.0.0 DHCP server
> > > > > 0.0.0.0 lease -1398609015 seconds

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to