Lines Matching refs:ip6h

200 	ip6_t		*ip6h;		/* Outer header */
207 ip6h = (ip6_t *)mp->b_rptr;
212 if (IN6_IS_ADDR_MULTICAST(&ip6h->ip6_src)) {
231 ip6h = ip_pullup(mp, ip_hdr_length + ICMP6_MINLEN, ira);
232 if (ip6h == NULL) {
240 DTRACE_PROBE2(icmp__inbound__v6, ip6_t *, ip6h, icmp6_t *, icmp6);
271 if (IN6_IS_ADDR_MULTICAST(&ip6h->ip6_dst) &&
293 ip6h = (ip6_t *)mp->b_rptr;
298 icmp_send_reply_v6(mp, ip6h, icmp6, ira);
402 ip6h = (ip6_t *)mp->b_rptr;
411 icmp_redirect_v6(mp, ip6h, (nd_redirect_t *)icmp6, ira);
432 icmp_send_reply_v6(mblk_t *mp, ip6_t *ip6h, icmp6_t *icmp6,
453 ip6h = (ip6_t *)mp->b_rptr;
454 ip6h->ip6_nxt = IPPROTO_ICMPV6;
455 i = ntohs(ip6h->ip6_plen);
457 ip6h->ip6_plen = htons(i);
459 ASSERT(ntohs(ip6h->ip6_plen) + IPV6_HDR_LEN == msgdsize(mp));
461 ip6h->ip6_vcf &= ~IPV6_FLOWINFO_FLOWLABEL;
464 origsrc = ip6h->ip6_src;
465 ip6h->ip6_src = ip6h->ip6_dst;
466 ip6h->ip6_dst = origsrc;
469 ip6h->ip6_hops = ipst->ips_ipv6_def_hops;
475 icmp6->icmp6_cksum = ip6h->ip6_plen;
495 if (!ipsec_in_to_out(ira, &ixas, mp, NULL, ip6h)) {
503 if (IN6_IS_ADDR_LINKSCOPE(&ip6h->ip6_src)) {
516 ip6h->ip6_src = ipv6_all_zeros;
546 ip6_t *ip6h; /* Inner header */
548 ip6h = (ip6_t *)&icmp6[1];
549 if ((uchar_t *)ip6h + IPV6_HDR_LEN > mp->b_wptr)
555 if ((IPH_HDR_VERSION(ip6h) != IPV6_VERSION))
560 if ((uchar_t *)ip6h + hdr_length > mp->b_wptr)
572 if (!ip_hdr_length_nexthdr_v6(mp, ip6h, &hdr_length, &nexthdrp))
583 if ((uchar_t *)ip6h + hdr_length + ICMP_MIN_TP_HDR_LEN >
594 if ((uchar_t *)ip6h + hdr_length + ICMP_MIN_TP_HDR_LEN >
598 tcpha = (tcpha_t *)((uchar_t *)ip6h + hdr_length);
603 connp = ipcl_tcp_lookup_reversed_ipv6(ip6h, tcpha, TCPS_LISTEN,
621 if ((uchar_t *)ip6h + hdr_length + ICMP_MIN_TP_HDR_LEN >
633 in_ip6h = (ip6_t *)((uint8_t *)ip6h + hdr_length);
679 ip6_t *ip6h; /* Inner IP header */
682 ip6h = (ip6_t *)&icmp6[1];
683 final_dst = ip_get_dst_v6(ip6h, NULL, NULL);
770 ip6_t *ip6h; /* Inner IP header */
781 ip6h = (ip6_t *)&icmp6[1];
783 ASSERT((uchar_t *)&ip6h[1] <= mp->b_wptr);
785 if (!ip_hdr_length_nexthdr_v6(mp, ip6h, &hdr_length, &nexthdrp))
792 * addresses reversed to do fanout/classification because the ip6h in
795 rip6h.ip6_src = ip6h->ip6_dst;
796 rip6h.ip6_dst = ip6h->ip6_src;
803 up = (uint16_t *)((uchar_t *)ip6h + hdr_length);
817 tcpha = (tcpha_t *)((uchar_t *)ip6h + hdr_length);
822 connp = ipcl_tcp_lookup_reversed_ipv6(ip6h, tcpha,
831 NULL, ip6h, ira);
861 up = (uint16_t *)((uchar_t *)ip6h + hdr_length);
899 ip6h = (ip6_t *)mp->b_rptr;
901 if (ip6h->ip6_nxt != IPPROTO_ICMPV6)
902 hdr_length = ip_hdr_length_v6(mp, ip6h);
920 in_ip6h = (ip6_t *)((uint8_t *)ip6h + hdr_length);
922 if (IN6_ARE_ADDR_EQUAL(&in_ip6h->ip6_src, &ip6h->ip6_src) &&
923 IN6_ARE_ADDR_EQUAL(&in_ip6h->ip6_dst, &ip6h->ip6_dst)) {
945 bcopy(in_ip6h, ip6h, mp->b_wptr - (uchar_t *)in_ip6h);
952 ip6h = (ip6_t *)mp->b_rptr;
954 if (ip6h->ip6_nxt != IPPROTO_ICMPV6)
955 hdr_length = ip_hdr_length_v6(mp, ip6h);
1013 icmp_redirect_v6(mblk_t *mp, ip6_t *ip6h, nd_redirect_t *rd,
1049 src = &ip6h->ip6_src;
1055 (ip6h->ip6_hops != IPV6_MAX_HOPS) ||
1264 ip6_t *ip6h;
1275 ip6h = (ip6_t *)mp->b_rptr;
1291 if (IN6_IS_ADDR_LINKSCOPE(&ip6h->ip6_src)) {
1308 if (!ipsec_in_to_out(ira, &ixas, mp, NULL, ip6h)) {
1333 if (IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_src) ||
1334 IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_dst))
1337 ire = ire_ftable_lookup_v6(&ip6h->ip6_dst, 0, 0,
1341 v6src = ip6h->ip6_dst;
1348 v6dst = ip6h->ip6_src;
1377 ip6h = (ip6_t *)mp->b_rptr;
1378 mp1->b_wptr = (uchar_t *)ip6h + (IPV6_HDR_LEN + len);
1380 ip6h->ip6_vcf = IPV6_DEFAULT_VERS_AND_FLOW;
1381 ip6h->ip6_nxt = IPPROTO_ICMPV6;
1382 ip6h->ip6_hops = ipst->ips_ipv6_def_hops;
1383 ip6h->ip6_dst = v6dst;
1384 ip6h->ip6_src = v6src;
1390 ip6h->ip6_plen = htons((uint16_t)(msgdsize(mp) - IPV6_HDR_LEN));
1391 icmp6 = (icmp6_t *)&ip6h[1];
1397 icmp6->icmp6_cksum = ip6h->ip6_plen;
1399 ip6h->ip6_hops = IPV6_MAX_HOPS;
1489 ip6_t *ip6h;
1497 ip6h = (ip6_t *)mp->b_rptr;
1501 if (IN6_IS_ADDR_MULTICAST(&ip6h->ip6_src) ||
1502 IN6_IS_ADDR_V4MAPPED(&ip6h->ip6_src) ||
1503 IN6_IS_ADDR_UNSPECIFIED(&ip6h->ip6_src)) {
1508 if (ip6h->ip6_nxt == IPPROTO_ICMPV6) {
1519 ip6h = (ip6_t *)mp->b_rptr;
1521 icmp6 = (icmp6_t *)&ip6h[1];
1535 (llbcast || IN6_IS_ADDR_MULTICAST(&ip6h->ip6_dst))) {
1566 ip_send_potential_redirect_v6(mblk_t *mp, ip6_t *ip6h, ire_t *ire,
1580 if (ip_source_routed_v6(ip6h, mp, ipst))
1585 v6targ = &ip6h->ip6_dst;
1605 src_ire_v6 = ire_ftable_lookup_v6(&ip6h->ip6_src,
1620 icmp_send_redirect_v6(mp1, v6targ, &ip6h->ip6_dst, ira);
1822 ip6_t *ip6h = (ip6_t *)mp->b_rptr;
1829 if (!ip_hdr_length_nexthdr_v6(mp, ip6h, &hdr_length, &nexthdrp)) {
2298 ip_fanout_proto_v6(mblk_t *mp, ip6_t *ip6h, ip_recv_attr_t *ira)
2301 in6_addr_t laddr = ip6h->ip6_dst;
2313 if (IPCL_PROTO_MATCH_V6(connp, ira, ip6h) &&
2344 if (IPCL_PROTO_MATCH_V6(connp, ira, ip6h) &&
2382 ip_fanout_proto_conn(connp, mp, NULL, ip6h, ira);
2400 ip6_t *ip6h;
2416 ip6h = (ip6_t *)mp->b_rptr;
2418 mp = ipsec_check_global_policy(mp, NULL, NULL, ip6h, ira, ns);
2481 ip_fanout_udp_multi_v6(mblk_t *mp, ip6_t *ip6h, uint16_t lport, uint16_t fport,
2493 laddr = ip6h->ip6_dst;
2494 faddr = ip6h->ip6_src;
2502 conn_wantpacket_v6(connp, ira, ip6h) &&
2524 conn_wantpacket_v6(connp, ira, ip6h) &&
2565 ip_fanout_udp_conn(connp, mp, NULL, ip6h, ira);
2578 ip_fanout_proto_v6(mp, ip6h, ira);
2606 ip_find_hdr_v6(mblk_t *mp, ip6_t *ip6h, boolean_t label_separate, ip_pkt_t *ipp,
2618 ipp->ipp_hoplimit = ip6h->ip6_hops;
2619 ipp->ipp_tclass = IPV6_FLOW_TCLASS(ip6h->ip6_flow);
2620 ipp->ipp_addr = ip6h->ip6_dst;
2623 whereptr = ((uint8_t *)&ip6h[1]); /* point to next hdr */
2626 nexthdr = ip6h->ip6_nxt;
2753 ip_hdr_length_nexthdr_v6(mblk_t *mp, ip6_t *ip6h, uint16_t *hdr_length_ptr,
2765 ASSERT(IPH_HDR_VERSION(ip6h) == IPV6_VERSION);
2767 whereptr = ((uint8_t *)&ip6h[1]); /* point to next hdr */
2770 nexthdrp = &ip6h->ip6_nxt;
2840 ip_hdr_length_v6(mblk_t *mp, ip6_t *ip6h)
2845 (void) ip_hdr_length_nexthdr_v6(mp, ip6h, &hdr_len, &nexthdrp);
2868 ip_process_options_v6(mblk_t *mp, ip6_t *ip6h,
2981 tmp = ip6h->ip6_src;
2983 ip6h->ip6_src = *(in6_addr_t *)oh->ip6oh_addr;
3033 (uint8_t *)ip6h),
3044 (uint8_t *)ip6h),
3061 (uint32_t)(optptr - (uint8_t *)ip6h),
3071 ip_process_rthdr(mblk_t *mp, ip6_t *ip6h, ip6_rthdr_t *rth,
3090 (uint32_t)((uchar_t *)&rth->ip6r_type - (uchar_t *)ip6h),
3149 ip6_t *ip6h;
3160 ip6h = (ip6_t *)mp->b_rptr;
3162 whereptr = ((uint8_t *)&ip6h[1]); /* point to next hdr */
3170 nexthdrp = &ip6h->ip6_nxt;
3294 ip_input_fragment_v6(mblk_t *mp, ip6_t *ip6h,
3381 prev_nexthdr_offset = (uint8_t *)&ip6h->ip6_nxt - (uint8_t *)ip6h;
3382 prev_nexthdr = ip6h->ip6_nxt;
3383 ptr = (uint8_t *)&ip6h[1];
3393 - (uint8_t *)ip6h;
3404 - (uint8_t *)ip6h;
3414 - (uint8_t *)ip6h;
3438 if (more_frags && (ntohs(ip6h->ip6_plen) & 7)) {
3441 (uint32_t)((char *)&ip6h->ip6_plen -
3442 (char *)ip6h), B_FALSE, ira);
3446 v6src_ptr = &ip6h->ip6_src;
3447 v6dst_ptr = &ip6h->ip6_dst;
3450 hdr_length = (uint_t)((char *)&fraghdr[1] - (char *)ip6h);
3462 (char *)ip6h), B_FALSE, ira);
3484 ecn_info = (uint8_t)(ntohl(ip6h->ip6_vcf & htonl(~0xFFCFFFFF)) >> 20);
3864 ip6h = (ip6_t *)mp->b_rptr;
3865 ((char *)ip6h)[prev_nexthdr_offset] = nexthdr;
3869 ip6h->ip6_plen = htons((uint16_t)(packet_size - IPV6_HDR_LEN));
3871 ip6h->ip6_vcf &= htonl(0xFFCFFFFF);
3872 ip6h->ip6_vcf |= htonl(ecn_info << 20);
3938 ip_get_dst_v6(ip6_t *ip6h, const mblk_t *mp, boolean_t *is_fragment)
3946 whereptr = (uint8_t *)ip6h;
3953 rv = ip6h->ip6_dst;
3954 nexthdr = ip6h->ip6_nxt;
3979 mp, mblk_t *, current_mp, ip6_t *, ip6h);
4015 ip_source_routed_v6(ip6_t *ip6h, mblk_t *mp, ip_stack_t *ipst)
4026 nexthdr = ip6h->ip6_nxt;
4032 byteptr = (uint8_t *)ip6h + ehdrlen;
4050 byteptr = (uint8_t *)ip6h + ehdrlen;
4108 ip6_t *ip6h = (ip6_t *)mp->b_rptr;
4138 ASSERT(ntohs(ip6h->ip6_plen) + IPV6_HDR_LEN == pkt_len);
4147 nexthdr = ip6h->ip6_nxt;
4148 ptr = (uint8_t *)&ip6h[1];
4185 unfragmentable_len = (uint_t)(ptr - (uint8_t *)ip6h);
4207 bcopy(ip6h, fip6h, unfragmentable_len);
4319 ip6_t *ip6h = (ip6_t *)mp->b_rptr;
4336 nexthdr = ip6h->ip6_nxt;
4337 prev_nexthdr_offset = (uint8_t *)&ip6h->ip6_nxt - (uint8_t *)ip6h;
4338 ptr = (uint8_t *)&ip6h[1];
4348 - (uint8_t *)ip6h;
4360 - (uint8_t *)ip6h;
4371 - (uint8_t *)ip6h;
4375 unfragmentable_len = (uint_t)(ptr - (uint8_t *)ip6h);
4398 bcopy(ip6h, fip6h, unfragmentable_len);
4424 conn_wantpacket_v6(conn_t *connp, ip_recv_attr_t *ira, ip6_t *ip6h)
4429 in6_addr_t *v6dst_ptr = &ip6h->ip6_dst;
4430 in6_addr_t *v6src_ptr = &ip6h->ip6_src;
4571 ip6_t *ip6h = (ip6_t *)buf;
4574 ip6h->ip6_vcf =
4580 ip6h->ip6_vcf = IPV6_TCLASS_FLOW(ip6h->ip6_vcf,
4585 ip6h->ip6_hops = ipp->ipp_hoplimit;
4587 ip6h->ip6_hops = ipp->ipp_unicast_hops;
4591 ip6h->ip6_src = ipp->ipp_addr;
4593 nxthdr_ptr = (uint8_t *)&ip6h->ip6_nxt;
4594 cp = (uint8_t *)&ip6h[1];
4702 ip_find_rthdr_v6(ip6_t *ip6h, uint8_t *endptr)
4708 uint8_t *ptr = (uint8_t *)&ip6h[1];
4710 if (ip6h->ip6_nxt == IPPROTO_ROUTING)
4724 nexthdr = ip6h->ip6_nxt;
4769 ip_massage_options_v6(ip6_t *ip6h, ip6_rthdr_t *rth, netstack_t *ns)
4794 ptr = (uint16_t *)&ip6h->ip6_dst;
4814 *addrptr = ip6h->ip6_dst;
4815 ip6h->ip6_dst = tmp;
4824 ptr = (uint16_t *)&ip6h->ip6_dst;
4942 ip6_t *ip6h;
4952 ip6h = (ip6_t *)mp->b_rptr;
4954 nexthdr = ip6h->ip6_nxt;
4955 whereptr = (uint8_t *)&ip6h[1];