MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ip6_input

Function ip6_input

freebsd/netinet6/ip6_input.c:532–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530#endif
531
532void
533ip6_input(struct mbuf *m)
534{
535 struct in6_addr odst;
536 struct ip6_hdr *ip6;
537 struct in6_ifaddr *ia;
538 struct ifnet *rcvif;
539 u_int32_t plen;
540 u_int32_t rtalert = ~0;
541 int off = sizeof(struct ip6_hdr), nest;
542 int nxt, ours = 0;
543 int srcrt = 0;
544
545 /*
546 * Drop the packet if IPv6 operation is disabled on the interface.
547 */
548 rcvif = m->m_pkthdr.rcvif;
549 if ((ND_IFINFO(rcvif)->flags & ND6_IFF_IFDISABLED))
550 goto bad;
551
552#if defined(IPSEC) || defined(IPSEC_SUPPORT)
553 /*
554 * should the inner packet be considered authentic?
555 * see comment in ah4_input().
556 * NB: m cannot be NULL when passed to the input routine
557 */
558
559 m->m_flags &= ~M_AUTHIPHDR;
560 m->m_flags &= ~M_AUTHIPDGM;
561
562#endif /* IPSEC */
563
564 if (m->m_flags & M_FASTFWD_OURS) {
565 /*
566 * Firewall changed destination to local.
567 */
568 ip6 = mtod(m, struct ip6_hdr *);
569 goto passin;
570 }
571
572 /*
573 * mbuf statistics
574 */
575 if (m->m_flags & M_EXT) {
576 if (m->m_next)
577 IP6STAT_INC(ip6s_mext2m);
578 else
579 IP6STAT_INC(ip6s_mext1);
580 } else {
581 if (m->m_next) {
582 if (m->m_flags & M_LOOP) {
583 IP6STAT_INC(ip6s_m2m[V_loif->if_index]);
584 } else if (rcvif->if_index < IP6S_M2MMAX)
585 IP6STAT_INC(ip6s_m2m[rcvif->if_index]);
586 else
587 IP6STAT_INC(ip6s_m2m[0]);
588 } else
589 IP6STAT_INC(ip6s_m1);

Callers 1

ng_ipfw_rcvdataFunction · 0.85

Calls 15

m_move_pkthdrFunction · 0.85
m_copydataFunction · 0.85
m_pullupFunction · 0.85
ip6_tryforwardFunction · 0.85
pfil_run_hooksFunction · 0.85
ip6_forwardFunction · 0.85
in6_clearscopeFunction · 0.85
in6_setscopeFunction · 0.85
in6ifa_ifwithaddrFunction · 0.85
ip6_sprintfFunction · 0.85
ifa_freeFunction · 0.85
ip6_input_hbhFunction · 0.85

Tested by

no test coverage detected