Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161861121
D20843.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20843.id.diff
View Options
Index: head/sys/powerpc/pseries/phyp_llan.c
===================================================================
--- head/sys/powerpc/pseries/phyp_llan.c
+++ head/sys/powerpc/pseries/phyp_llan.c
@@ -157,14 +157,23 @@
struct llan_softc *sc;
phandle_t node;
int error, i;
+ ssize_t len;
sc = device_get_softc(dev);
sc->dev = dev;
/* Get firmware properties */
node = ofw_bus_get_node(dev);
- OF_getprop(node, "local-mac-address", sc->mac_address,
+ len = OF_getprop(node, "local-mac-address", sc->mac_address,
sizeof(sc->mac_address));
+ /* If local-mac-address property has only 6 bytes (ETHER_ADDR_LEN)
+ * instead of 8 (sizeof(sc->mac_address)), then its value must be
+ * shifted 2 bytes to the right. */
+ if (len == ETHER_ADDR_LEN) {
+ bcopy(sc->mac_address, &sc->mac_address[2], len);
+ /* Zero out the first 2 bytes. */
+ bzero(sc->mac_address, 2);
+ }
OF_getencprop(node, "reg", &sc->unit, sizeof(sc->unit));
mtx_init(&sc->io_lock, "llan", NULL, MTX_DEF);
@@ -504,7 +513,7 @@
{
struct ifnet *ifp = sc->ifp;
struct ifmultiaddr *inm;
- uint64_t macaddr;
+ uint64_t macaddr = 0;
mtx_assert(&sc->io_lock, MA_OWNED);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 8, 12:36 PM (15 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34844387
Default Alt Text
D20843.id.diff (1 KB)
Attached To
Mode
D20843: [PPC64] pseries llan: fix MAC address
Attached
Detach File
Event Timeline
Log In to Comment