Lines Matching refs:ip6

119 #include <netinet/ip6.h>
247 struct ip6_hdr *ip6;
262 ip6 = mtod(m, struct ip6_hdr *);
264 if (in6_setscope(&ip6->ip6_src, ifp, NULL) != 0)
266 if (in6_setscope(&ip6->ip6_dst, ifp, NULL) != 0)
435 struct ip6_hdr *ip6, *nip6;
455 ip6 = mtod(m, struct ip6_hdr *);
465 if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
469 IN6_LOOKUP_MULTI(&ip6->ip6_dst, ifp, inm);
492 icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
505 icmp6->icmp6_type, sum, ip6_sprintf(&ip6->ip6_src)));
607 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
651 bcopy(ip6, nip6, sizeof(struct ip6_hdr));
701 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
735 if ((icmp6_nodeinfo & 8) != 8 && in6_addrscope(&ip6->ip6_src) == IPV6_ADDR_SCOPE_GLOBAL)
745 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
774 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
797 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
820 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
843 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
866 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
891 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
898 icmp6->icmp6_type, ip6_sprintf(&ip6->ip6_src),
899 ip6_sprintf(&ip6->ip6_dst),
911 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
931 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
1266 struct ip6_hdr *ip6;
1270 ip6 = mtod(m, struct ip6_hdr *);
1295 !IN6_IS_ADDR_LOOPBACK(&ip6->ip6_src) &&
1296 !IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src))
1307 if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
1308 if (!IN6_IS_ADDR_MC_LINKLOCAL(&ip6->ip6_dst))
1390 sin6_d.sin6_addr = ip6->ip6_dst;
1392 &ip6->ip6_dst);
2058 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
2068 icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
2084 rip6src.sin6_addr = ip6->ip6_src;
2096 !IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, &ip6->ip6_dst))
2099 !IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &ip6->ip6_src))
2163 * Reflect the ip6 packet back to the source.
2171 struct ip6_hdr *ip6;
2192 "sanity fail: off=%lx, sizeof(ip6)=%lx in %s:%d\n",
2228 ip6 = mtod(m, struct ip6_hdr *);
2229 ip6->ip6_nxt = IPPROTO_ICMPV6;
2230 icmp6 = (struct icmp6_hdr *)(ip6 + 1);
2234 t = ip6->ip6_dst;
2239 ip6->ip6_dst = ip6->ip6_src;
2249 sa6_src.sin6_addr = ip6->ip6_dst;
2250 in6_recoverscope(&sa6_src, &ip6->ip6_dst, m->m_pkthdr.rcvif);
2251 in6_embedscope(&ip6->ip6_dst, &sa6_src, NULL, NULL, NULL);
2302 sin6.sin6_addr = ip6->ip6_dst; /* zone ID should be embedded */
2322 oflow = ip6->ip6_flow; /* Save for later */
2323 ip6->ip6_src = *src;
2324 ip6->ip6_flow = 0;
2325 ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
2326 ip6->ip6_vfc |= IPV6_VERSION;
2328 ip6->ip6_flow |= (oflow & htonl(0x0ff00000));
2330 ip6->ip6_nxt = IPPROTO_ICMPV6;
2335 ip6->ip6_hlim = ndi->chlim;
2343 ip6->ip6_hlim = ndi->chlim;
2346 ip6->ip6_hlim = ip6_defhlim;
2404 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
2406 int icmp6len = ntohs(ip6->ip6_plen);
2414 struct in6_addr src6 = ip6->ip6_src;
2433 nd_rd = (struct nd_redirect *)((caddr_t)ip6 + off);
2456 if (ip6->ip6_hlim != 255) {
2460 ip6_sprintf(&src6), ip6->ip6_hlim));
2464 /* ip6->ip6_src must be equal to gw for icmp6->icmp6_reddst */
2626 struct ip6_hdr *ip6; /* m as struct ip6_hdr */
2702 /* get ip6 linklocal address for ifp(my outgoing interface). */
2714 /* get ip6 linklocal address for the router. */
2724 /* ip6 */
2725 ip6 = mtod(m, struct ip6_hdr *);
2726 ip6->ip6_flow = 0;
2727 ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
2728 ip6->ip6_vfc |= IPV6_VERSION;
2729 /* ip6->ip6_plen will be set later */
2730 ip6->ip6_nxt = IPPROTO_ICMPV6;
2731 ip6->ip6_hlim = 255;
2732 /* ip6->ip6_src must be linklocal addr for my outgoing if. */
2733 bcopy(&ifp_ll6, &ip6->ip6_src, sizeof(struct in6_addr));
2734 bcopy(&sip6->ip6_src, &ip6->ip6_dst, sizeof(struct in6_addr));
2737 nd_rd = (struct nd_redirect *)(ip6 + 1);
2783 if (len + (p - (u_char *)ip6) > maxlen) {
2807 m->m_pkthdr.len = m->m_len = p - (u_char *)ip6;
2814 if (p - (u_char *)ip6 > maxlen)
2826 len = maxlen - (p - (u_char *)ip6);
2844 * ip6 header)
2880 m->m_pkthdr.len = m->m_len = p - (u_char *)ip6;
2894 ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(struct ip6_hdr));
2898 = in6_cksum(m, IPPROTO_ICMPV6, sizeof(*ip6), ntohs(ip6->ip6_plen));