1772 *indx = 0;
1773 *type = OTH;
1774 fanout_unaligned++;
1775 return (0);
1776 }
1777
1778 /*
1779 * Extract next-header, full header length, and source-hash value
1780 * using v4/v6 specific fields.
1781 */
1782 if (v6) {
1783 remlen = ntohs(ip6h->ip6_plen);
1784 nexthdr = ip6h->ip6_nxt;
1785 src_val = V4_PART_OF_V6(ip6h->ip6_src);
1786 dst_val = V4_PART_OF_V6(ip6h->ip6_dst);
1787 /*
1788 * Do src based fanout if below tunable is set to B_TRUE or
1789 * when mac_ip_hdr_length_v6() fails because of malformed
1790 * packets or because mblks need to be concatenated using
1791 * pullupmsg().
1792 */
1793 if (!mac_ip_hdr_length_v6(ip6h, mp->b_wptr, &hdr_len, &nexthdr,
1794 NULL)) {
1795 goto src_dst_based_fanout;
1796 }
1797 } else {
1798 hdr_len = IPH_HDR_LENGTH(ipha);
1799 remlen = ntohs(ipha->ipha_length) - hdr_len;
1800 nexthdr = ipha->ipha_protocol;
1801 src_val = (uint32_t)ipha->ipha_src;
1802 dst_val = (uint32_t)ipha->ipha_dst;
1803 /*
1804 * Catch IPv4 fragment case here. IPv6 has nexthdr == FRAG
1805 * for its equivalent case.
1806 */
1807 if ((ntohs(ipha->ipha_fragment_offset_and_flags) &
1808 (IPH_MF | IPH_OFFSET)) != 0) {
1809 goto src_dst_based_fanout;
1810 }
1811 }
1812 if (remlen < MIN_EHDR_LEN)
1813 return (-1);
|
1772 *indx = 0;
1773 *type = OTH;
1774 fanout_unaligned++;
1775 return (0);
1776 }
1777
1778 /*
1779 * Extract next-header, full header length, and source-hash value
1780 * using v4/v6 specific fields.
1781 */
1782 if (v6) {
1783 remlen = ntohs(ip6h->ip6_plen);
1784 nexthdr = ip6h->ip6_nxt;
1785 src_val = V4_PART_OF_V6(ip6h->ip6_src);
1786 dst_val = V4_PART_OF_V6(ip6h->ip6_dst);
1787 /*
1788 * Do src based fanout if below tunable is set to B_TRUE or
1789 * when mac_ip_hdr_length_v6() fails because of malformed
1790 * packets or because mblks need to be concatenated using
1791 * pullupmsg().
1792 *
1793 * Perform a version check to prevent parsing weirdness...
1794 */
1795 if (IPH_HDR_VERSION(ip6h) != IPV6_VERSION ||
1796 !mac_ip_hdr_length_v6(ip6h, mp->b_wptr, &hdr_len, &nexthdr,
1797 NULL)) {
1798 goto src_dst_based_fanout;
1799 }
1800 } else {
1801 hdr_len = IPH_HDR_LENGTH(ipha);
1802 remlen = ntohs(ipha->ipha_length) - hdr_len;
1803 nexthdr = ipha->ipha_protocol;
1804 src_val = (uint32_t)ipha->ipha_src;
1805 dst_val = (uint32_t)ipha->ipha_dst;
1806 /*
1807 * Catch IPv4 fragment case here. IPv6 has nexthdr == FRAG
1808 * for its equivalent case.
1809 */
1810 if ((ntohs(ipha->ipha_fragment_offset_and_flags) &
1811 (IPH_MF | IPH_OFFSET)) != 0) {
1812 goto src_dst_based_fanout;
1813 }
1814 }
1815 if (remlen < MIN_EHDR_LEN)
1816 return (-1);
|