Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/arch/evbarm/awin Pull up following revision(s) (reque...
details: https://anonhg.NetBSD.org/src/rev/eb4114036237
branches: netbsd-7
changeset: 798543:eb4114036237
user: martin <martin%NetBSD.org@localhost>
date: Tue Nov 11 12:48:59 2014 +0000
description:
Pull up following revision(s) (requested by jmcneill in ticket #211):
sys/arch/evbarm/awin/awin_machdep.c: revision 1.27
get_bootconf_option doesnt return the value null-terminated, so look for an awge0.mac-address value of exactly the correct length
diffstat:
sys/arch/evbarm/awin/awin_machdep.c | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diffs (44 lines):
diff -r fb118f6e5903 -r eb4114036237 sys/arch/evbarm/awin/awin_machdep.c
--- a/sys/arch/evbarm/awin/awin_machdep.c Tue Nov 11 12:28:28 2014 +0000
+++ b/sys/arch/evbarm/awin/awin_machdep.c Tue Nov 11 12:48:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_machdep.c,v 1.8.2.4 2014/11/09 14:42:33 martin Exp $ */
+/* $NetBSD: awin_machdep.c,v 1.8.2.5 2014/11/11 12:48:59 martin Exp $ */
/*
* Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.8.2.4 2014/11/09 14:42:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_machdep.c,v 1.8.2.5 2014/11/11 12:48:59 martin Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@@ -724,14 +724,18 @@
char *mac_addr;
snprintf(argname, sizeof(argname), "%s.mac-address",
device_xname(self));
+
if (get_bootconf_option(boot_args, argname,
- BOOTOPT_TYPE_STRING, &mac_addr) &&
- ether_aton_r(enaddr, sizeof(enaddr), mac_addr) == 0) {
- prop_data_t pd;
- pd = prop_data_create_data(enaddr, sizeof(enaddr));
- KASSERT(pd != NULL);
- prop_dictionary_set(dict, "mac-address", pd);
- prop_object_release(pd);
+ BOOTOPT_TYPE_STRING, &mac_addr)) {
+ char mac[strlen("XX:XX:XX:XX:XX:XX") + 1];
+ strlcpy(mac, mac_addr, sizeof(mac));
+ if (!ether_aton_r(enaddr, sizeof(enaddr), mac)) {
+ prop_data_t pd;
+ pd = prop_data_create_data(enaddr, sizeof(enaddr));
+ KASSERT(pd != NULL);
+ prop_dictionary_set(dict, "mac-address", pd);
+ prop_object_release(pd);
+ }
}
#if AWIN_board == AWIN_cubieboard
Home |
Main Index |
Thread Index |
Old Index