| 328 | } |
| 329 | |
| 330 | static int |
| 331 | in6_gif_input(struct mbuf *m, int off, int proto, void *arg) |
| 332 | { |
| 333 | struct gif_softc *sc = arg; |
| 334 | struct ifnet *gifp; |
| 335 | struct ip6_hdr *ip6; |
| 336 | uint8_t ecn; |
| 337 | |
| 338 | NET_EPOCH_ASSERT(); |
| 339 | if (sc == NULL) { |
| 340 | m_freem(m); |
| 341 | IP6STAT_INC(ip6s_nogif); |
| 342 | return (IPPROTO_DONE); |
| 343 | } |
| 344 | gifp = GIF2IFP(sc); |
| 345 | if ((gifp->if_flags & IFF_UP) != 0) { |
| 346 | ip6 = mtod(m, struct ip6_hdr *); |
| 347 | ecn = (ntohl(ip6->ip6_flow) >> 20) & 0xff; |
| 348 | m_adj(m, off); |
| 349 | gif_input(m, gifp, proto, ecn); |
| 350 | } else { |
| 351 | m_freem(m); |
| 352 | IP6STAT_INC(ip6s_nogif); |
| 353 | } |
| 354 | return (IPPROTO_DONE); |
| 355 | } |
| 356 | |
| 357 | static int |
| 358 | in6_gif_lookup(const struct mbuf *m, int off, int proto, void **arg) |