+#pragma unused(ifp, protocol)
+ struct ether_header *eh = (struct ether_header *)(void *)header;
+ u_int16_t ether_type;
+
+ bcopy(&eh->ether_type, ðer_type, sizeof(ether_type));
+
+ if (ether_type == htons(ETHERTYPE_IPV6)) {
+ struct ifnet *mifp;
+ /*
+ * Trust the ifp in the mbuf, rather than ifproto's
+ * since the packet could have been injected via
+ * a dlil_input_packet_list() using an ifp that is
+ * different than the one where the packet really
+ * came from.
+ */
+ mifp = mbuf_pkthdr_rcvif(packet);
+
+ /* Update L2 reachability record, if present (and not bcast) */
+ if (bcmp(eh->ether_shost, etherbroadcastaddr,
+ ETHER_ADDR_LEN) != 0) {
+ nd6_llreach_set_reachable(mifp, eh->ether_shost,
+ ETHER_ADDR_LEN);
+ }
+
+ /* Save the Ethernet source address for all-nodes multicasts */
+ if (!bcmp(eh->ether_dhost, etherip6allnodes, ETHER_ADDR_LEN)) {
+ struct ip6aux *ip6a;
+
+ ip6a = ip6_addaux(packet);
+ if (ip6a) {
+ ip6a->ip6a_flags |= IP6A_HASEEN;
+ bcopy(eh->ether_shost, ip6a->ip6a_ehsrc,
+ ETHER_ADDR_LEN);
+ }
+ }
+
+ if (proto_input(protocol, packet) != 0) {
+ m_freem(packet);
+ }
+ } else {
+ m_freem(packet);
+ }
+
+ return EJUSTRETURN;