| 572 | */ |
| 573 | #ifdef INET6 |
| 574 | int |
| 575 | tcp6_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 | |
| 612 | int |
nothing calls this directly
no test coverage detected