- int s;
- register struct ifqueue *ifq;
- struct mbuf *m;
-
- /*
- * Place interface pointer before the data
- * for the receiving protocol.
- */
- if (m0->m_off <= MMAXOFF &&
- m0->m_off >= MMINOFF + sizeof(struct ifnet *)) {
- m0->m_off -= sizeof(struct ifnet *);
- m0->m_len += sizeof(struct ifnet *);
- } else {
- MGET(m, M_DONTWAIT, MT_HEADER);
- if (m == (struct mbuf *)0)
- return (ENOBUFS);
- m->m_off = MMINOFF;
- m->m_len = sizeof(struct ifnet *);
- m->m_next = m0;
- m0 = m;
+ int s, isr;
+ register struct ifqueue *ifq = 0;
+
+ if ((m->m_flags & M_PKTHDR) == 0)
+ panic("looutput no HDR");
+ ifp->if_lastchange = time;
+#if NBPFILTER > 0
+ if (loif.if_bpf) {
+ /*
+ * We need to prepend the address family as
+ * a four byte field. Cons up a dummy header
+ * to pacify bpf. This is safe because bpf
+ * will only read from the mbuf (i.e., it won't
+ * try to free it or keep a pointer a to it).
+ */
+ struct mbuf m0;
+ u_int af = dst->sa_family;
+
+ m0.m_next = m;
+ m0.m_len = 4;
+ m0.m_data = (char *)⁡
+
+ bpf_mtap(loif.if_bpf, &m0);
+ }
+#endif
+ m->m_pkthdr.rcvif = ifp;
+
+ if (rt && rt->rt_flags & RTF_REJECT) {
+ m_freem(m);
+ return (rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);