Re: looking for open tasks

"Axel Dörfler" <[email protected]> Thu, 01 Mar 2007 08:57:58 +0100 CET
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <1725966795-BeMail@zon>
"François Revol" <[email protected]> wrote:
> > The automatic IP address configuration only needs ARP queries for 
> > example to achieve dynamic configuration of IPv4 local addresses.
> > Could be a good starting
> Yes it's quite dumb, pick an address in a specific range and try 
> using 
> it until someone claims it's theirs, but then you're in trouble :)

That's what our net_server is currently doing when DHCP fails and there 
is no configuration:

	uint8 mac[6];
	uint8 last = 56;
	if (get_mac_address(fDevice.String(), mac) == B_OK) {
		// choose IP address depending on the MAC address, if available
		last = mac[0] ^ mac[1] ^ mac[2] ^ mac[3] ^ mac[4] ^ mac[5];
		if (last > 253)
			last = 253;
		else if (last == 0)
			last = 1;
	}

	char string[64];
	snprintf(string, sizeof(string), "192.168.0.%u", last);

Of course, the ARP check for this address is currently missing, but at 
least it'll be somewhat constant :-)

Bye,
   Axel.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV