| 174 | DECLARE_MODULE(if_disc, disc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); |
| 175 | |
| 176 | static int |
| 177 | discoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, |
| 178 | struct route *ro) |
| 179 | { |
| 180 | u_int32_t af; |
| 181 | |
| 182 | M_ASSERTPKTHDR(m); |
| 183 | |
| 184 | /* BPF writes need to be handled specially. */ |
| 185 | if (dst->sa_family == AF_UNSPEC) |
| 186 | bcopy(dst->sa_data, &af, sizeof(af)); |
| 187 | else |
| 188 | af = dst->sa_family; |
| 189 | |
| 190 | if (bpf_peers_present(ifp->if_bpf)) |
| 191 | bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); |
| 192 | |
| 193 | m->m_pkthdr.rcvif = ifp; |
| 194 | |
| 195 | if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); |
| 196 | if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); |
| 197 | |
| 198 | m_freem(m); |
| 199 | return (0); |
| 200 | } |
| 201 | |
| 202 | /* |
| 203 | * Process an ioctl request. |
nothing calls this directly
no test coverage detected