diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -447,6 +447,7 @@ #ifdef _KERNEL #include +#include struct ifnet; struct mbuf; @@ -479,10 +480,18 @@ static __inline struct mbuf *ether_vlanencap(struct mbuf *m, uint16_t tag) { - return ether_vlanencap_proto(m, tag, ETHERTYPE_VLAN); } +/* Create an ether_addr from an array of u_char (or uint8_t). */ +__nodiscard static __inline __unused struct ether_addr +make_ether_addr(const u_char *__octets) +{ + struct ether_addr __ret; + memcpy(&__ret.octet[0], __octets, ETHER_ADDR_LEN); + return (__ret); +} + /* new ethernet interface attached event */ typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t);