Skip to contentSkip to conversation

env: disable CONFIG_ETHADDR & CONFIG_IPADDR

PATCH New Alexey Brodkin 2 participants 2 messages Feb 10, 2014 – Feb 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env: disable CONFIG_ETHADDR & CONFIG_IPADDR

We don't want to have duplicates of the same MAC or/and IP address within one network. But if those values are hard-coded into particular board config chances are high that multiple instances of the same board may easily have the same IP/MAC addresses.

As for disabled options CONFIG_GATEWAYIP and CONFIG_NETMASK - they make no sense without CONFIG_IPADDR.

If this change is acceptable on the next step whether as a separate follow-up patch or v2 re-spin I may do a clean-up of existing configs.

Cc Wolfgang Denk <[email protected]>
Cc Tom Rini <[email protected]>
Cc Vineet Gupta <[email protected]>
---
 include/env_default.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
include/env_default.h +9 -9
index 90431be..c1dbaa3 100644
@@ -50,28 +50,28 @@ const uchar default_environment[] = {
 	"loads_echo="	__stringify(CONFIG_LOADS_ECHO)	"\0"
 #endif
 #ifdef	CONFIG_ETHADDR
-	"ethaddr="	__stringify(CONFIG_ETHADDR)	"\0"
+# error "Please DO NOT set CONFIG_ETHADDR in board configuration!"
 #endif
 #ifdef	CONFIG_ETH1ADDR
-	"eth1addr="	__stringify(CONFIG_ETH1ADDR)	"\0"
+# error "Please DO NOT set CONFIG_ETH1ADDR in board configuration!"
 #endif
 #ifdef	CONFIG_ETH2ADDR
-	"eth2addr="	__stringify(CONFIG_ETH2ADDR)	"\0"
+# error "Please DO NOT set CONFIG_ETH2ADDR in board configuration!"
 #endif
 #ifdef	CONFIG_ETH3ADDR
-	"eth3addr="	__stringify(CONFIG_ETH3ADDR)	"\0"
+# error "Please DO NOT set CONFIG_ETH3ADDR in board configuration!"
 #endif
 #ifdef	CONFIG_ETH4ADDR
-	"eth4addr="	__stringify(CONFIG_ETH4ADDR)	"\0"
+# error "Please DO NOT set CONFIG_ETH4ADDR in board configuration!"
 #endif
 #ifdef	CONFIG_ETH5ADDR
-	"eth5addr="	__stringify(CONFIG_ETH5ADDR)	"\0"
+# error "Please DO NOT set CONFIG_ETH5ADDR in board configuration!"
 #endif
 #ifdef	CONFIG_ETHPRIME
 	"ethprime="	CONFIG_ETHPRIME			"\0"
 #endif
 #ifdef	CONFIG_IPADDR
-	"ipaddr="	__stringify(CONFIG_IPADDR)	"\0"
+# error "Please DO NOT set CONFIG_IPADDR in board configuration!"
 #endif
 #ifdef	CONFIG_SERVERIP
 	"serverip="	__stringify(CONFIG_SERVERIP)	"\0"
@@ -86,10 +86,10 @@ const uchar default_environment[] = {
 	"rootpath="	CONFIG_ROOTPATH			"\0"
 #endif
 #ifdef	CONFIG_GATEWAYIP
-	"gatewayip="	__stringify(CONFIG_GATEWAYIP)	"\0"
+# error "Please DO NOT set CONFIG_GATEWAYIP in board configuration!"
 #endif
 #ifdef	CONFIG_NETMASK
-	"netmask="	__stringify(CONFIG_NETMASK)	"\0"
+# error "Please DO NOT set CONFIG_NETMASK in board configuration!"
 #endif
 #ifdef	CONFIG_HOSTNAME
 	"hostname="	__stringify(CONFIG_HOSTNAME)	"\0"
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH 1/1 env: disable CONFIG_ETHADDR & CONFIG_IPADDR

Quoted 8 lines · Alexey Brodkin

We don't want to have duplicates of the same MAC or/and IP address within one network. But if those values are hard-coded into particular board config chances are high that multiple instances of the same board may easily have the same IP/MAC addresses.

As for disabled options CONFIG_GATEWAYIP and CONFIG_NETMASK - they make no sense without CONFIG_IPADDR.

Quoted 8 lines

If this change is acceptable on the next step whether as a separate follow-up patch or v2 re-spin I may do a clean-up of existing configs.

Cc Wolfgang Denk <[email protected]>
Cc Tom Rini <[email protected]>
Cc Vineet Gupta <[email protected]>

This is the right thing to do, but we need to also fixup the currently broken boards when we do this too. A 2 part series where 1/2 removes this from current users and 2/2 is this patch to catch out of tree folks, etc, should do it.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140221/18564ebc/attachment.pgp>