diff options
author | rpokala <rpokala@FreeBSD.org> | 2017-05-11 06:46:39 +0000 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-05-11 09:01:24 -0300 |
commit | 9c3f06697f1eb45c62202c7236c9495109a1b9f6 (patch) | |
tree | b55927e7163662f09709f39d87a0cc19067bf0a0 | |
parent | 2fe001a4af97c84ec26f23e9a8ec4ae3c630e747 (diff) | |
download | FreeBSD-src-9c3f06697f1eb45c62202c7236c9495109a1b9f6.zip FreeBSD-src-9c3f06697f1eb45c62202c7236c9495109a1b9f6.tar.gz |
Persistently store NIC's hardware MAC address, and add a way to retrive it
An earlier version of r318160 allocated if_hw_addr unconditionally; when it
became conditional, I forgot to check for NULL in ether_ifattach().
Reviewed by: kp
MFC after: 1 week
MFC with: r318160
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D10678
Pointy-hat to: rpokala
(cherry picked from commit 22bc11147b048ef4ae05cca49ca9c6baf8fe9993)
-rw-r--r-- | sys/net/if_ethersubr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 34bc54f6..bb79eec 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -928,7 +928,8 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) sdl->sdl_alen = ifp->if_addrlen; bcopy(lla, LLADDR(sdl), ifp->if_addrlen); - bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen); + if (ifp->if_hw_addr != NULL) + bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen); bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN); if (ng_ether_attach_p != NULL) |