Print this page
10409 ipf sometimes freezes RFC 1323 transfers
Reviewed by: Jason King <jbk@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ipf/ip_state.c
          +++ new/usr/src/uts/common/inet/ipf/ip_state.c
↓ open down ↓ 1721 lines elided ↑ open up ↑
1722 1722                          is->is_s0[source] = ntohl(tcp->th_ack);
1723 1723                          is->is_s0[!source] = ntohl(tcp->th_seq) + 1;
1724 1724                          if (TCP_OFF(tcp) > (sizeof (tcphdr_t) >> 2)) {
1725 1725                                  (void) fr_tcpoptions(fin, tcp, fdata);
1726 1726                          }
1727 1727                          if ((fin->fin_out != 0) && (is->is_pass & FR_NEWISN))
1728 1728                                  fr_checknewisn(fin, is);
1729 1729                  } else if (flags == TH_SYN) {
1730 1730                          is->is_s0[source] = ntohl(tcp->th_seq) + 1;
1731 1731                          if ((TCP_OFF(tcp) > (sizeof(tcphdr_t) >> 2)))
1732      -                                (void) fr_tcpoptions(fin, tcp, tdata);
     1732 +                                (void) fr_tcpoptions(fin, tcp, fdata);
1733 1733  
1734 1734                          if ((fin->fin_out != 0) && (is->is_pass & FR_NEWISN))
1735 1735                                  fr_checknewisn(fin, is);
1736 1736  
1737 1737                  }
1738 1738                  ret = 1;
1739 1739          } else
1740 1740                  fin->fin_flx |= FI_OOW;
1741 1741          MUTEX_EXIT(&is->is_lock);
1742 1742          return ret;
↓ open down ↓ 90 lines elided ↑ open up ↑
1833 1833           * for windows not in the first SYN packet. In that packet the
1834 1834           * window is 65535 to specify the largest window possible
1835 1835           * for receivers not implementing the window scale option.
1836 1836           * Currently, we do not assume TTCP here. That means that
1837 1837           * if we see a second packet from a host (after the initial
1838 1838           * SYN), we can assume that the receiver of the SYN did
1839 1839           * already send back the SYN/ACK (and thus that we know if
1840 1840           * the receiver also does window scaling)
1841 1841           */
1842 1842          if (!(tcpflags & TH_SYN) && (fdata->td_winflags & TCP_WSCALE_FIRST)) {
     1843 +                fdata->td_winflags &= ~TCP_WSCALE_FIRST;
1843 1844                  fdata->td_maxwin = win;
1844 1845          }
1845 1846  
1846 1847          end = seq + dsize;
1847 1848  
1848 1849          if ((fdata->td_end == 0) &&
1849 1850              (!(flags & IS_TCPFSM) ||
1850 1851               ((tcpflags & TH_OPENING) == TH_OPENING))) {
1851 1852                  /*
1852 1853                   * Must be a (outgoing) SYN-ACK in reply to a SYN.
↓ open down ↓ 42 lines elided ↑ open up ↑
1895 1896                   * this is upperbound check
1896 1897                   */
1897 1898              (SEQ_GE(fdata->td_maxend, end)) &&
1898 1899                  /*
1899 1900                   * this is lowerbound check
1900 1901                   */
1901 1902              (SEQ_GE(seq, fdata->td_end - maxwin)) &&
1902 1903  #endif
1903 1904  /* XXX what about big packets */
1904 1905  #define MAXACKWINDOW 66000
1905      -            (-ackskew <= (MAXACKWINDOW << fdata->td_winscale)) &&
     1906 +            (-ackskew <= (MAXACKWINDOW)) &&
1906 1907              ( ackskew <= (MAXACKWINDOW << fdata->td_winscale))) {
1907 1908                  inseq = 1;
1908 1909          /*
1909 1910           * Microsoft Windows will send the next packet to the right of the
1910 1911           * window if SACK is in use.
1911 1912           */
1912 1913          } else if ((seq == fdata->td_maxend) && (ackskew == 0) &&
1913 1914              (fdata->td_winflags & TCP_SACK_PERMIT) &&
1914 1915              (tdata->td_winflags & TCP_SACK_PERMIT)) {
1915 1916                  inseq = 1;
↓ open down ↓ 2530 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX