Lines Matching defs:ip6

96 #include <netinet/ip6.h>
250 struct ip6_hdr *ip6;
252 ip6 = mtod(m, struct ip6_hdr *);
254 nxt = ip6->ip6_nxt;
274 struct ip6_hdr *ip6;
276 if (m->m_len < sizeof(*ip6)) {
277 m = m_pullup(m, sizeof(*ip6));
284 ip6 = mtod(m, struct ip6_hdr *);
286 if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) {
294 if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src) ||
295 IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst)) {
302 if ((IN6_IS_ADDR_LOOPBACK(&ip6->ip6_src) ||
303 IN6_IS_ADDR_LOOPBACK(&ip6->ip6_dst)) &&
309 if (((IN6_IS_SCOPE_EMBED(&ip6->ip6_src) && ip6->ip6_src.s6_addr16[1]) ||
310 (IN6_IS_SCOPE_EMBED(&ip6->ip6_dst) && ip6->ip6_dst.s6_addr16[1])) &&
315 if (IN6_IS_ADDR_MC_INTFACELOCAL(&ip6->ip6_dst) &&
339 if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) ||
340 IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) {
350 if (IN6_IS_ADDR_V4COMPAT(&ip6->ip6_src) ||
351 IN6_IS_ADDR_V4COMPAT(&ip6->ip6_dst)) {
367 struct ip6_hdr *ip6;
384 ip6 = mtod(m, struct ip6_hdr *);
387 if (carp_lsdrop(ifp, m, AF_INET6, ip6->ip6_src.s6_addr32,
388 ip6->ip6_dst.s6_addr32, (ip6->ip6_nxt == IPPROTO_ICMPV6 ? 0 : 1)))
391 ip6stat_inc(ip6s_nxthist + ip6->ip6_nxt);
399 if (IN6_IS_SCOPE_EMBED(&ip6->ip6_src)) {
400 src_scope = ip6->ip6_src.s6_addr16[1];
401 ip6->ip6_src.s6_addr16[1] = 0;
403 if (IN6_IS_SCOPE_EMBED(&ip6->ip6_dst)) {
404 dst_scope = ip6->ip6_dst.s6_addr16[1];
405 ip6->ip6_dst.s6_addr16[1] = 0;
413 odst = ip6->ip6_dst;
420 ip6 = mtod(m, struct ip6_hdr *);
421 if (!IN6_ARE_ADDR_EQUAL(&odst, &ip6->ip6_dst))
439 if (IN6_IS_SCOPE_EMBED(&ip6->ip6_src))
440 ip6->ip6_src.s6_addr16[1] = src_scope;
441 if (IN6_IS_SCOPE_EMBED(&ip6->ip6_dst))
442 ip6->ip6_dst.s6_addr16[1] = dst_scope;
444 if (IN6_IS_SCOPE_EMBED(&ip6->ip6_src))
445 ip6->ip6_src.s6_addr16[1] = htons(ifp->if_index);
446 if (IN6_IS_SCOPE_EMBED(&ip6->ip6_dst))
447 ip6->ip6_dst.s6_addr16[1] = htons(ifp->if_index);
472 if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
484 if (in6_hasmulti(&ip6->ip6_dst, ifp))
495 ip6 = mtod(m, struct ip6_hdr *);
506 error = ip6_mforward(ip6, ifp, m, flags);
524 if (!IN6_IS_ADDR_MC_LINKLOCAL(&ip6->ip6_dst))
536 rt = route6_mpath(&ro, &ip6->ip6_dst, &ip6->ip6_src,
579 inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src));
580 inet_ntop(AF_INET6, &ip6->ip6_dst, dst, sizeof(dst));
594 if (ip6->ip6_nxt == IPPROTO_ICMPV6 &&
595 carp_lsdrop(ifp, m, AF_INET6, ip6->ip6_src.s6_addr32,
596 ip6->ip6_dst.s6_addr32, 1))
650 struct ip6_hdr *ip6;
654 ip6 = mtod(*mp, struct ip6_hdr *);
661 plen = (u_int32_t)ntohs(ip6->ip6_plen);
663 if (ip6->ip6_nxt == IPPROTO_HOPOPTS) {
670 ip6 = mtod(*mp, struct ip6_hdr *);
677 if (ip6->ip6_plen == 0 && plen == 0) {
686 (caddr_t)&ip6->ip6_plen - (caddr_t)ip6);
705 nxt = ip6->ip6_nxt;
737 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
740 u_int8_t proto = ip6->ip6_nxt;
743 off = ((caddr_t)ip6 - m->m_data) + sizeof(struct ip6_hdr);
744 lim = min(m->m_pkthdr.len, ntohs(ip6->ip6_plen) + sizeof(*ip6));
857 struct ip6_hdr *ip6;
912 ip6 = mtod(*mp, struct ip6_hdr *);
913 if (ip6->ip6_plen) {
990 struct ip6_hdr *ip6;
1004 ip6 = mtod(*mp, struct ip6_hdr *);
1005 if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) ||
1032 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
1047 memcpy(&pi6.ipi6_addr, &ip6->ip6_dst, sizeof(struct in6_addr));
1059 int hlim = ip6->ip6_hlim & 0xff;
1070 flowinfo = (u_int32_t)ntohl(ip6->ip6_flow & IPV6_FLOWINFO_MASK);
1095 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
1096 if (ip6->ip6_nxt == IPPROTO_HOPOPTS) {
1102 ip6->ip6_nxt);
1133 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
1134 int nxt = ip6->ip6_nxt, off = sizeof(struct ip6_hdr);
1295 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
1305 nxt = ip6->ip6_nxt;
1336 struct ip6_hdr ip6;
1348 if (m->m_pkthdr.len < off + sizeof(ip6))
1350 m_copydata(m, off, sizeof(ip6), &ip6);
1352 *nxtp = ip6.ip6_nxt;
1353 off += sizeof(ip6);