Print this page
4838 Fix for 4596 has some inverted booleans
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/udp/udp.c
          +++ new/usr/src/uts/common/inet/udp/udp.c
↓ open down ↓ 2725 lines elided ↑ open up ↑
2726 2726                          ixa->ixa_flags |= IXAF_SCOPEID_SET;
2727 2727                  } else {
2728 2728                          ixa->ixa_flags &= ~IXAF_SCOPEID_SET;
2729 2729                  }
2730 2730                  v4mapped = IN6_IS_ADDR_V4MAPPED(&v6dst);
2731 2731                  if (v4mapped)
2732 2732                          ixa->ixa_flags |= IXAF_IS_IPV4;
2733 2733                  else
2734 2734                          ixa->ixa_flags &= ~IXAF_IS_IPV4;
2735 2735                  if (srcid != 0 && IN6_IS_ADDR_UNSPECIFIED(&v6src)) {
2736      -                        if (ip_srcid_find_id(srcid, &v6src, IPCL_ZONEID(connp),
     2736 +                        if (!ip_srcid_find_id(srcid, &v6src, IPCL_ZONEID(connp),
2737 2737                              v4mapped, connp->conn_netstack)) {
2738 2738                                  /* Mismatch - v4mapped/v6 specified by srcid. */
2739 2739                                  mutex_exit(&connp->conn_lock);
2740 2740                                  error = EADDRNOTAVAIL;
2741 2741                                  goto failed;    /* Does freemsg() and mib. */
2742 2742                          }
2743 2743                  }
2744 2744          } else {
2745 2745                  /* Connected case */
2746 2746                  v6dst = connp->conn_faddr_v6;
↓ open down ↓ 1000 lines elided ↑ open up ↑
3747 3747                          ixa->ixa_flags |= IXAF_SCOPEID_SET;
3748 3748                  } else {
3749 3749                          ixa->ixa_flags &= ~IXAF_SCOPEID_SET;
3750 3750                  }
3751 3751                  v4mapped = IN6_IS_ADDR_V4MAPPED(&v6dst);
3752 3752                  if (v4mapped)
3753 3753                          ixa->ixa_flags |= IXAF_IS_IPV4;
3754 3754                  else
3755 3755                          ixa->ixa_flags &= ~IXAF_IS_IPV4;
3756 3756                  if (srcid != 0 && IN6_IS_ADDR_UNSPECIFIED(&v6src)) {
3757      -                        if (ip_srcid_find_id(srcid, &v6src, IPCL_ZONEID(connp),
     3757 +                        if (!ip_srcid_find_id(srcid, &v6src, IPCL_ZONEID(connp),
3758 3758                              v4mapped, connp->conn_netstack)) {
3759 3759                                  /* Mismatched v4mapped/v6 specified by srcid. */
3760 3760                                  mutex_exit(&connp->conn_lock);
3761 3761                                  error = EADDRNOTAVAIL;
3762 3762                                  goto ud_error;
3763 3763                          }
3764 3764                  }
3765 3765          }
3766 3766          /* Handle IP_PKTINFO/IPV6_PKTINFO setting source address. */
3767 3767          if (connp->conn_xmit_ipp.ipp_fields & IPPF_ADDR) {
↓ open down ↓ 1796 lines elided ↑ open up ↑
5564 5564                  ipversion = IPV4_VERSION;
5565 5565                  break;
5566 5566  
5567 5567          case sizeof (sin6_t):
5568 5568                  sin6 = (sin6_t *)sa;
5569 5569                  v6dst = sin6->sin6_addr;
5570 5570                  dstport = sin6->sin6_port;
5571 5571                  srcid = sin6->__sin6_src_id;
5572 5572                  v4mapped = IN6_IS_ADDR_V4MAPPED(&v6dst);
5573 5573                  if (srcid != 0 && IN6_IS_ADDR_UNSPECIFIED(&v6src)) {
5574      -                        if (ip_srcid_find_id(srcid, &v6src, IPCL_ZONEID(connp),
     5574 +                        if (!ip_srcid_find_id(srcid, &v6src, IPCL_ZONEID(connp),
5575 5575                              v4mapped, connp->conn_netstack)) {
5576 5576                                  /* Mismatch v4mapped/v6 specified by srcid. */
5577 5577                                  return (EADDRNOTAVAIL);
5578 5578                          }
5579 5579                  }
5580 5580                  if (v4mapped) {
5581 5581                          if (connp->conn_ipv6_v6only)
5582 5582                                  return (EADDRNOTAVAIL);
5583 5583  
5584 5584                          /*
↓ open down ↓ 877 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX