* 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. */
| 3915 | * their component interfaces as IFT_IEEE8023ADLAG. |
| 3916 | */ |
| 3917 | int |
| 3918 | if_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 |
no outgoing calls
no test coverage detected