[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #6683] Customizable AUTOIP "seed" address

From: Luca Ceresoli
Subject: [lwip-devel] [patch #6683] Customizable AUTOIP "seed" address
Date: Thu, 04 Dec 2008 11:33:48 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv: Gecko/2008102920 Firefox/3.0.4

Follow-up Comment #2, patch #6683 (project lwip):

> I've checked in a slightly modified version of the patch
Much cleaner, but I don't like the new meaning you gave to the seed.
In my original patch it is an entire IP address (hence the name
In your checkin it is simply a seed, not a copy of the IP address.
E.g. from seed 0x1234 the IP 0xa9fe1334 (1334, not 1234) will be generated.

Why the hell do I care?
My implementation was meant to eliminate conflicts on big networks (10-20.000
devices) that are rarely physically modified after installation.
This can be achieved by saving in non-volatile memory the IP address obtained
via AUTOIP, and used as a default at the next reboot. Result: no conflicts
after reboot -- even across temporary network partitions!
This would be a bit of a hack to implement unless the
LWIP_AUTOIP_CREATE_SEED_ADDR() macro returned a whole IPv4 address.

A few minor notes follow.

>  /* creates random LL IP-Address for a network interface */
> -static void autoip_create_rand_addr(struct netif *netif, struct ip_addr
> +static void autoip_create_addr(struct netif *netif, struct ip_addr
The "random" part was removed elsewhere, but not here.

In function autoip_create_addr():
> +  /* seed must be between .1.0 and .254.255 */
> +  if(seed < 0x0100) {
> +    seed += 0x0100;
> +  }
> +  if(seed > 0xFEFF) {
> +    see -= 0x0100;
> +  }
Also, these ifs should not be here since they are present a few lines later
(where also the effect of tried_llipaddr is taken into account).
There's also a typo (see -> seed) and an overbiasing of 0x0100.


Reply to this item at:


  Messaggio inviato con/da Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]