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

Function tcp6_input

freebsd/netinet/tcp_input.c:574–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

572 */
573#ifdef INET6
574int
575tcp6_input(struct mbuf **mp, int *offp, int proto)
576{
577 struct mbuf *m;
578 struct in6_ifaddr *ia6;
579 struct ip6_hdr *ip6;
580
581 m = *mp;
582 if (m->m_len < *offp + sizeof(struct tcphdr)) {
583 m = m_pullup(m, *offp + sizeof(struct tcphdr));
584 if (m == NULL) {
585 *mp = m;
586 TCPSTAT_INC(tcps_rcvshort);
587 return (IPPROTO_DONE);
588 }
589 }
590
591 /*
592 * draft-itojun-ipv6-tcp-to-anycast
593 * better place to put this in?
594 */
595 ip6 = mtod(m, struct ip6_hdr *);
596 ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */);
597 if (ia6 && (ia6->ia6_flags & IN6_IFF_ANYCAST)) {
598 ifa_free(&ia6->ia_ifa);
599 icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADDR,
600 (caddr_t)&ip6->ip6_dst - (caddr_t)ip6);
601 *mp = NULL;
602 return (IPPROTO_DONE);
603 }
604 if (ia6)
605 ifa_free(&ia6->ia_ifa);
606
607 *mp = m;
608 return (tcp_input(mp, offp, proto));
609}
610#endif /* INET6 */
611
612int

Callers

nothing calls this directly

Calls 5

m_pullupFunction · 0.85
in6ifa_ifwithaddrFunction · 0.85
ifa_freeFunction · 0.85
icmp6_errorFunction · 0.85
tcp_inputFunction · 0.85

Tested by

no test coverage detected