MCPcopy Create free account
hub / github.com/F-Stack/f-stack / if_gethwaddr

Function if_gethwaddr

freebsd/net/if.c:3917–3932  ·  view source on GitHub ↗

* Get the link layer address that was read from the hardware at attach. * * This is only set by Ethernet NICs (IFT_ETHER), but laggX interfaces re-type * their component interfaces as IFT_IEEE8023ADLAG. */

Source from the content-addressed store, hash-verified

3915 * their component interfaces as IFT_IEEE8023ADLAG.
3916 */
3917int
3918if_gethwaddr(struct ifnet *ifp, struct ifreq *ifr)
3919{
3920
3921 if (ifp->if_hw_addr == NULL)
3922 return (ENODEV);
3923
3924 switch (ifp->if_type) {
3925 case IFT_ETHER:
3926 case IFT_IEEE8023ADLAG:
3927 bcopy(ifp->if_hw_addr, ifr->ifr_addr.sa_data, ifp->if_addrlen);
3928 return (0);
3929 default:
3930 return (ENODEV);
3931 }
3932}
3933
3934/*
3935 * The name argument must be a pointer to storage which will last as

Callers 2

ifhwioctlFunction · 0.85
debugnet_pkt_inFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected