[En-Nut-Discussion] DHCP and four Ethernuts, IP conflict

Lars Andersson laran at ikp.liu.se
Wed Apr 30 11:13:23 CEST 2003


When looking at DHCP client thread in the dhcpc.c file one will find the following.

THREAD(NutDhcpClient, arg)
{
    DYNCFG *rxcfg;
    DYNCFG *txcfg;
    UDPSOCKET *sock;
    int n;
    int try;
    int wait_secs;
    u_short boot_secs;
    int got_offer;
    struct bootp *rxbuf;
    struct bootp *txbuf;
    u_long xid;
    NUTDEVICE *dev;
    IFNET *nif;

    dev = arg;
    nif = dev->dev_icb;
    xid = (u_short)nif;
....
}

If I understand it correctly the xid variable will be assigned the value equal to the address where the nif struct is pointing to. In case I liked to generate some random value for xid, is this the place where this should be done?

Regards,
/Lars

-----Original Message-----
From: Harald Kipp [mailto:harald.kipp at egnite.de]
Sent: den 29 april 2003 16:17
To: en-nut-discussion at egnite.de
Subject: Re: [En-Nut-Discussion] DHCP and four Ethernuts, IP conflict


This bug had been reported recently. The problem is, that Ethernut
doesn't use a random XID. With the broadcast method, two Ethernuts
may accept the same response.

One idea was to use the MAC address for creating a random value.

Harald

At 10:17 29.04.2003 +0200, you wrote:
>Hello!
>
>I have tried to set up a network with four ethernuts connected to PC via an
>ethernet switch.
>Now I have some problems with my dhcp sever  running on the PC (I am using
>Tftpd32
>version 2.54.) The first and the third unit that connect get the same
>IP-number. If I start
>with 192.168.0.10 for the first one, the second gets 192.168.0.11, the third
>gets 192.168.0.10
>and the fourth unit gets 192.168.0.12. The first and third units always get
>the same IP address.
>
>Does anyone have a suggestion of how to solve this problem?
>
>
>Regards
>Tom Nyström
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo/en-nut-discussion

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list