[En-Nut-Discussion] Problem with NutDhcpIfConfig()

Benoit Smeysters smeystersb at hotmail.com
Wed Apr 1 12:11:40 CEST 2009

Hi everybody,
I have a probleme with example tcps.c.
When I test the program with my ethernut board and the cable Ethernet is connected, every is OK.
printf("Configure eth0...");
    if (NutDhcpIfConfig("eth0", 0, 60000)) {                         A)
        printf("initial boot...");                                             C)
        if (NutDhcpIfConfig("eth0", mac, 60000)) {
            u_long ip_addr = inet_addr("");
            u_long ip_mask = inet_addr("");
            printf("no DHCP...");
            NutNetIfConfig("eth0", mac, ip_addr, ip_mask);
            /* If not in a local network, we must also call 
               NutIpRouteAdd() to configure the routing. */
    puts("OK");                                                               B)
But when I disconnect the cable, program execution stop 60 secondes in A) and then go to B.
I have the same output on the UART wiht and wihtout cable. Like if my ethernut board think it is still connected to the switch.
When cable is disconnected, program execution must go to C) ?
If there is no cable connected to the board (thus no DHCP server), NutDhcpIfConfig() must not return 0 and then program execution go to C) ?


Where is the probleme ?
Benoît Smeysters
Rue des Meuniers 17
4470 Dommartin

Perdu dans tous vos carnets d'adresses ? Rassemblez vos contacts Windows Live, Facebook, LinkedIn…

More information about the En-Nut-Discussion mailing list