···272272 * sCL -> sCL273273 */274274/* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */275275-/*ack*/ { sIV, sIV, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },275275+/*ack*/ { sIV, sIG, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },276276/*277277- * sSS -> sIV Might be a half-open connection.277277+ * sSS -> sIG Might be a half-open connection.278278 * sSR -> sSR Might answer late resent SYN.279279 * sES -> sES :-)280280 * sFW -> sCW Normal close request answered by ACK.···917917918918 switch (new_state) {919919 case TCP_CONNTRACK_IGNORE:920920- /* Either SYN in ORIGINAL921921- * or SYN/ACK in REPLY. */920920+ /* Ignored packets:921921+ * 922922+ * a) SYN in ORIGINAL923923+ * b) SYN/ACK in REPLY924924+ * c) ACK in reply direction after initial SYN in original.925925+ */922926 if (index == TCP_SYNACK_SET923927 && conntrack->proto.tcp.last_index == TCP_SYN_SET924928 && conntrack->proto.tcp.last_dir != dir···989985 }990986 case TCP_CONNTRACK_CLOSE:991987 if (index == TCP_RST_SET992992- && test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)993993- && conntrack->proto.tcp.last_index == TCP_SYN_SET988988+ && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)989989+ && conntrack->proto.tcp.last_index == TCP_SYN_SET)990990+ || (!test_bit(IPS_ASSURED_BIT, &conntrack->status)991991+ && conntrack->proto.tcp.last_index == TCP_ACK_SET))994992 && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) {995995- /* RST sent to invalid SYN we had let trough996996- * SYN was in window then, tear down connection.993993+ /* RST sent to invalid SYN or ACK we had let trough994994+ * at a) and c) above:995995+ *996996+ * a) SYN was in window then997997+ * c) we hold a half-open connection.998998+ *999999+ * Delete our connection entry.9971000 * We skip window checking, because packet might ACK998998- * segments we ignored in the SYN. */10011001+ * segments we ignored. */9991002 goto in_window;10001003 }10011004 /* Just fall trough */
···280280 * sCL -> sCL281281 */282282/* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */283283-/*ack*/ { sIV, sIV, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },283283+/*ack*/ { sIV, sIG, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },284284/*285285- * sSS -> sIV Might be a half-open connection.285285+ * sSS -> sIG Might be a half-open connection.286286 * sSR -> sSR Might answer late resent SYN.287287 * sES -> sES :-)288288 * sFW -> sCW Normal close request answered by ACK.···912912913913 switch (new_state) {914914 case TCP_CONNTRACK_IGNORE:915915- /* Either SYN in ORIGINAL916916- * or SYN/ACK in REPLY. */915915+ /* Ignored packets:916916+ *917917+ * a) SYN in ORIGINAL918918+ * b) SYN/ACK in REPLY919919+ * c) ACK in reply direction after initial SYN in original. 920920+ */917921 if (index == TCP_SYNACK_SET918922 && conntrack->proto.tcp.last_index == TCP_SYN_SET919923 && conntrack->proto.tcp.last_dir != dir···983979 }984980 case TCP_CONNTRACK_CLOSE:985981 if (index == TCP_RST_SET986986- && test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)987987- && conntrack->proto.tcp.last_index == TCP_SYN_SET982982+ && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)983983+ && conntrack->proto.tcp.last_index == TCP_SYN_SET)984984+ || (!test_bit(IPS_ASSURED_BIT, &conntrack->status)985985+ && conntrack->proto.tcp.last_index == TCP_ACK_SET))988986 && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) {989989- /* RST sent to invalid SYN we had let trough990990- * SYN was in window then, tear down connection.987987+ /* RST sent to invalid SYN or ACK we had let trough988988+ * at a) and c) above:989989+ *990990+ * a) SYN was in window then991991+ * c) we hold a half-open connection.992992+ *993993+ * Delete our connection entry.991994 * We skip window checking, because packet might ACK992992- * segments we ignored in the SYN. */995995+ * segments we ignored. */993996 goto in_window;994997 }995998 /* Just fall trough */