public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] common: nvedit to protect additional ethernet addresses Part 1/1
@ 2008-12-04 12:28 stefan.althoefer at web.de
  2008-12-04 12:46 ` Jerry Van Baren
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: stefan.althoefer at web.de @ 2008-12-04 12:28 UTC (permalink / raw)
  To: u-boot

[PATCH] common: nvedit to protect additional ethernet addresses

This patch adds "ethaddr1" and "ethaddr2" to the protected
environment variables that can only be written once.

----
The patch is against "latest" u-boot git-repository

Please be patient if style of submission or patches are
offending.

Signed-off-by: stefan.althoefer at web.de  (as at janz.de)
----

diff -uprN u-boot-orig//common/cmd_nvedit.c u-boot/common/cmd_nvedit.c
--- u-boot-orig//common/cmd_nvedit.c	2008-12-02 17:25:31.000000000 +0100
+++ u-boot/common/cmd_nvedit.c	2008-12-02 22:59:36.000000000 +0100
@@ -188,6 +188,8 @@ int _do_setenv (int flag, int argc, char
 #else
 		    (strcmp (name, "serial#") == 0) ||
 #endif
+		    (strcmp (name, "ethaddr1") == 0) ||
+		    (strcmp (name, "ethaddr2") == 0) ||
 		    ((strcmp (name, "ethaddr") == 0)
 #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
 		     && (strcmp ((char *)env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0)

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [U-Boot] [PATCH] common: nvedit to protect additional ethernet addresses Part 1/1
@ 2008-12-04 20:06 Stefan Althöfer
  2008-12-04 21:06 ` Ben Warren
  2008-12-15 22:56 ` Wolfgang Denk
  0 siblings, 2 replies; 23+ messages in thread
From: Stefan Althöfer @ 2008-12-04 20:06 UTC (permalink / raw)
  To: u-boot

Then maybe we should have

#define CONFIG_ENV_PROTECTED_ITEM "ethaddr1,ethaddr2,...."

in board configuration to have the greatest flexibility?

> stefan.althoefer at web.de wrote:
> > [PATCH] common: nvedit to protect additional ethernet addresses
> >
> > This patch adds "ethaddr1" and "ethaddr2" to the protected
> > environment variables that can only be written once.
> >
> > ----
> > The patch is against "latest" u-boot git-repository
> >
> > Please be patient if style of submission or patches are
> > offending.
> >
> > Signed-off-by: stefan.althoefer at web.de  (as at janz.de)
> >   
> This needs to be above a '---' line.  Also, this format is wrong.  It 
> should have a real name and one e-mail address.  I recommend using 'git 
> format-patch' for generating patches.
> > ----
> >
> > diff -uprN u-boot-orig//common/cmd_nvedit.c u-boot/common/cmd_nvedit.c
> > --- u-boot-orig//common/cmd_nvedit.c	2008-12-02 17:25:31.000000000 +0100
> > +++ u-boot/common/cmd_nvedit.c	2008-12-02 22:59:36.000000000 +0100
> > @@ -188,6 +188,8 @@ int _do_setenv (int flag, int argc, char
> >  #else
> >  		    (strcmp (name, "serial#") == 0) ||
> >  #endif
> > +		    (strcmp (name, "ethaddr1") == 0) ||
> > +		    (strcmp (name, "ethaddr2") == 0) ||
> >  		    ((strcmp (name, "ethaddr") == 0)
> >   
> How about this as a more scalable solution: (note that some boards have 
> up to "ethaddr5")
> 
>        (strstr(name, "ethaddr") == name)
> >  #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
> >  		     && (strcmp ((char *)env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0)
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >   
> regards,
> Ben
> 


_______________________________________________________________________
Sensationsangebot verl?ngert: WEB.DE FreeDSL - Telefonanschluss + DSL
f?r nur 16,37 Euro/mtl.!* http://dsl.web.de/?ac=OM.AD.AD008K13805B7069a

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

end of thread, other threads:[~2008-12-16 21:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-04 12:28 [U-Boot] [PATCH] common: nvedit to protect additional ethernet addresses Part 1/1 stefan.althoefer at web.de
2008-12-04 12:46 ` Jerry Van Baren
2008-12-04 17:57 ` Ben Warren
2008-12-04 20:48 ` Jerry Van Baren
2008-12-05 21:22   ` Stefan Althoefer
2008-12-07  0:43     ` Wolfgang Denk
2008-12-07  2:53       ` Jerry Van Baren
2008-12-07  5:47         ` Ben Warren
2008-12-07  9:33           ` Wolfgang Denk
2008-12-07 13:31     ` Stefan Althoefer
2008-12-07 16:26       ` Wolfgang Denk
2008-12-07 18:54         ` Stefan Althoefer
2008-12-07 21:25           ` Wolfgang Denk
2008-12-07 23:52             ` Stefan Althoefer
2008-12-15 22:55               ` Wolfgang Denk
2008-12-16 21:34                 ` Stefan Althoefer
2008-12-08 20:14       ` Jerry Van Baren
  -- strict thread matches above, loose matches on Subject: below --
2008-12-04 20:06 Stefan Althöfer
2008-12-04 21:06 ` Ben Warren
2008-12-15 22:56 ` Wolfgang Denk
2008-12-16 19:15   ` Stefan Althoefer
2008-12-16 19:22     ` Ben Warren
2008-12-16 20:55       ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox