diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-11-22 17:14:16 +0100 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-11-24 10:59:47 +0100 |
commit | 4737144db1acbb1374616bafa4e569aac139c5aa (patch) | |
tree | 3270fef4f04c6559d13f76674cc8d83c966eb9a1 /clients/net-snk | |
parent | 7345fac3e5d1828b0cdf8196fe8bd7afb109e1ab (diff) | |
download | SLOF-4737144db1acbb1374616bafa4e569aac139c5aa.zip SLOF-4737144db1acbb1374616bafa4e569aac139c5aa.tar.gz SLOF-4737144db1acbb1374616bafa4e569aac139c5aa.tar.bz2 |
Check whether local-mac-address property exists before using its value
Fixed network booting for device tree nodes that do not provide a
local-mac-address property by default.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'clients/net-snk')
-rw-r--r-- | clients/net-snk/oflib/of.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clients/net-snk/oflib/of.c b/clients/net-snk/oflib/of.c index 31aa7f0..e74d2b0 100644 --- a/clients/net-snk/oflib/of.c +++ b/clients/net-snk/oflib/of.c @@ -793,11 +793,12 @@ get_mac(char *mac) int len; phandle_t net = get_boot_device(); - if (net == -1) return; len = of_getprop(net, "local-mac-address", localmac, 8); + if (len <= 0) + return; if (len == 8) { /* Some bad FDT nodes like veth use a 8-byte wide |