
Dear Kumar Gala,
In message 1219163066-27896-1-git-send-email-galak@kernel.crashing.org you wrote:
Move to using the environment variables 'ethaddr', 'eth1addr', etc.. instead of bd->bi_enetaddr, bi_enet1addr, etc.
This makes the code a bit more flexible to the number of ethernet interfaces.
Signed-off-by: Kumar Gala galak@kernel.crashing.org
Iterate over the aliases since its simplier than inventing a wheel to iterate over the environment. This removes the hard coded limit.
Please iterate over the environment variables as discussed earlier.
I don't think there is any need to invent wheels to iterate over the environment. It should probably be as simple as that:
char mac[16]; char *val; int i = 0;
strcpy (mac, "ethaddr");
while ((val = getenv(mac)) != NULL) { ... sprintf (mac, "eth%daddr", ++i); }
I call that a loop, not a wheel :-)
- sprintf(mac, idx ? "eth%daddr" : "ethaddr", idx);
That should generate a nasty compiler warning about number of arguments ...
Best regards,
Wolfgang Denk