Print this page
9832 Original bug discovered as 9560 has friends IPv4 packets coming in as IPv6 creating chaos

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/mac/mac_sched.c
          +++ new/usr/src/uts/common/io/mac/mac_sched.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24      - * Copyright 2017 Joyent, Inc.
       24 + * Copyright 2018 Joyent, Inc.
  25   25   * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  26   26   */
  27   27  
  28   28  /*
  29   29   * MAC data path
  30   30   *
  31   31   * The MAC data path is concerned with the flow of traffic from mac clients --
  32   32   * DLS, IP, etc. -- to various GLDv3 device drivers -- e1000g, vnic, aggr,
  33   33   * ixgbe, etc. -- and from the GLDv3 device drivers back to clients.
  34   34   *
↓ open down ↓ 1747 lines elided ↑ open up ↑
1782 1782          if (v6) {
1783 1783                  remlen = ntohs(ip6h->ip6_plen);
1784 1784                  nexthdr = ip6h->ip6_nxt;
1785 1785                  src_val = V4_PART_OF_V6(ip6h->ip6_src);
1786 1786                  dst_val = V4_PART_OF_V6(ip6h->ip6_dst);
1787 1787                  /*
1788 1788                   * Do src based fanout if below tunable is set to B_TRUE or
1789 1789                   * when mac_ip_hdr_length_v6() fails because of malformed
1790 1790                   * packets or because mblks need to be concatenated using
1791 1791                   * pullupmsg().
1792      -                 *
1793      -                 * Perform a version check to prevent parsing weirdness...
1794 1792                   */
1795      -                if (IPH_HDR_VERSION(ip6h) != IPV6_VERSION ||
1796      -                    !mac_ip_hdr_length_v6(ip6h, mp->b_wptr, &hdr_len, &nexthdr,
     1793 +                if (!mac_ip_hdr_length_v6(ip6h, mp->b_wptr, &hdr_len, &nexthdr,
1797 1794                      NULL)) {
1798 1795                          goto src_dst_based_fanout;
1799 1796                  }
1800 1797          } else {
1801 1798                  hdr_len = IPH_HDR_LENGTH(ipha);
1802 1799                  remlen = ntohs(ipha->ipha_length) - hdr_len;
1803 1800                  nexthdr = ipha->ipha_protocol;
1804 1801                  src_val = (uint32_t)ipha->ipha_src;
1805 1802                  dst_val = (uint32_t)ipha->ipha_dst;
1806 1803                  /*
↓ open down ↓ 3188 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX