public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] dhcp XID generation
@ 2001-05-03  8:08 Robin Farine
  2001-05-03  8:30 ` Hugo Tyson
  0 siblings, 1 reply; 5+ messages in thread
From: Robin Farine @ 2001-05-03  8:08 UTC (permalink / raw)
  To: ecos-discuss

Hi,

In a system with a single power supply but many independent boards running eCos
and using the DHCP client, switching the system on sometimes results into some
boards configured with the *same* parameters (IP address, ...).

The problem resides in the method used to generate the DHCP request's XID
field. A solution that seems to work for us follows:

<Changelog>
2001-05-03  Robin Farine  <acnrf@dial.eunet.ch>

	* src/lib/dhcp_prot.c (do_dhcp): Uses arc4random() instead of
	cyg_current_time() to generate the XID field to improve randomness.
</Changelog>

<patch>
Index: packages/net/tcpip/current/src/lib/dhcp_prot.c
===================================================================
RCS file: /usr/cvs/eCos/packages/net/net/tcpip/current/src/lib/dhcp_prot.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -r1.1.1.1 -r1.2
397c397
<         xid = (cyg_uint32)res + (cyg_uint32)(0xffffffff & cyg_current_time());
---
>         xid = (cyg_uint32)res + (cyg_uint32)arc4random();
</patch>

Robin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-05-09 10:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-03  8:08 [ECOS] dhcp XID generation Robin Farine
2001-05-03  8:30 ` Hugo Tyson
2001-05-03 10:52   ` Robin Farine
2001-05-04 10:40   ` Robin Farine
2001-05-09 10:30     ` Hugo Tyson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).