[En-Nut-Discussion] Problem with NutDhcpIfConfig()
Paulo Silva(OpenSoftware)
psilva at opensoftware-br.com
Wed Apr 1 16:08:56 CEST 2009
Hi,
Looking into NutDhcpIfConfig, you have 4 possibility as described below:
1 - If you have configuration into eeprom, it is used and your code goes
to B.
2 - If dhcp has did his job.(this is not the case because you take off
the cable).
3 - If interface was configured by arp.(your code goes to B).
4 - If dhcp failed but system has remenbered last configuration.(your
code goes to B).
So you should verify what this situations are happening.
regards
PSilva
Benoit Smeysters escreveu:
> 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("192.168.16.35");
> u_long ip_mask = inet_addr("255.255.255.0");
> 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 ?
>
> Thank
>
> Benoît Smeysters
> Student
> Rue des Meuniers 17
> 4470 Dommartin
> Belgium
>
>
> _________________________________________________________________
> Perdu dans tous vos carnets d'adresses ? Rassemblez vos contacts Windows Live, Facebook, LinkedIn…
> http://profile.live.com/connect
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
>
More information about the En-Nut-Discussion
mailing list