···272 * sCL -> sCL273 */274/* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */275-/*ack*/ { sIV, sIV, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },276/*277- * sSS -> sIV Might be a half-open connection.278 * sSR -> sSR Might answer late resent SYN.279 * sES -> sES :-)280 * sFW -> sCW Normal close request answered by ACK.···917918 switch (new_state) {919 case TCP_CONNTRACK_IGNORE:920- /* Either SYN in ORIGINAL921- * or SYN/ACK in REPLY. */0000922 if (index == TCP_SYNACK_SET923 && conntrack->proto.tcp.last_index == TCP_SYN_SET924 && conntrack->proto.tcp.last_dir != dir···989 }990 case TCP_CONNTRACK_CLOSE:991 if (index == TCP_RST_SET992- && test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)993- && conntrack->proto.tcp.last_index == TCP_SYN_SET00994 && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) {995- /* RST sent to invalid SYN we had let trough996- * SYN was in window then, tear down connection.00000997 * We skip window checking, because packet might ACK998- * segments we ignored in the SYN. */999 goto in_window;1000 }1001 /* Just fall trough */
···272 * sCL -> sCL273 */274/* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */275+/*ack*/ { sIV, sIG, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },276/*277+ * sSS -> sIG Might be a half-open connection.278 * sSR -> sSR Might answer late resent SYN.279 * sES -> sES :-)280 * sFW -> sCW Normal close request answered by ACK.···917918 switch (new_state) {919 case TCP_CONNTRACK_IGNORE:920+ /* Ignored packets:921+ * 922+ * a) SYN in ORIGINAL923+ * b) SYN/ACK in REPLY924+ * c) ACK in reply direction after initial SYN in original.925+ */926 if (index == TCP_SYNACK_SET927 && conntrack->proto.tcp.last_index == TCP_SYN_SET928 && conntrack->proto.tcp.last_dir != dir···985 }986 case TCP_CONNTRACK_CLOSE:987 if (index == TCP_RST_SET988+ && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)989+ && conntrack->proto.tcp.last_index == TCP_SYN_SET)990+ || (!test_bit(IPS_ASSURED_BIT, &conntrack->status)991+ && conntrack->proto.tcp.last_index == TCP_ACK_SET))992 && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) {993+ /* RST sent to invalid SYN or ACK we had let trough994+ * at a) and c) above:995+ *996+ * a) SYN was in window then997+ * c) we hold a half-open connection.998+ *999+ * Delete our connection entry.1000 * We skip window checking, because packet might ACK1001+ * segments we ignored. */1002 goto in_window;1003 }1004 /* Just fall trough */
···280 * sCL -> sCL281 */282/* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */283-/*ack*/ { sIV, sIV, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },284/*285- * sSS -> sIV Might be a half-open connection.286 * sSR -> sSR Might answer late resent SYN.287 * sES -> sES :-)288 * sFW -> sCW Normal close request answered by ACK.···912913 switch (new_state) {914 case TCP_CONNTRACK_IGNORE:915- /* Either SYN in ORIGINAL916- * or SYN/ACK in REPLY. */0000917 if (index == TCP_SYNACK_SET918 && conntrack->proto.tcp.last_index == TCP_SYN_SET919 && conntrack->proto.tcp.last_dir != dir···983 }984 case TCP_CONNTRACK_CLOSE:985 if (index == TCP_RST_SET986- && test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)987- && conntrack->proto.tcp.last_index == TCP_SYN_SET00988 && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) {989- /* RST sent to invalid SYN we had let trough990- * SYN was in window then, tear down connection.00000991 * We skip window checking, because packet might ACK992- * segments we ignored in the SYN. */993 goto in_window;994 }995 /* Just fall trough */
···280 * sCL -> sCL281 */282/* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */283+/*ack*/ { sIV, sIG, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV },284/*285+ * sSS -> sIG Might be a half-open connection.286 * sSR -> sSR Might answer late resent SYN.287 * sES -> sES :-)288 * sFW -> sCW Normal close request answered by ACK.···912913 switch (new_state) {914 case TCP_CONNTRACK_IGNORE:915+ /* Ignored packets:916+ *917+ * a) SYN in ORIGINAL918+ * b) SYN/ACK in REPLY919+ * c) ACK in reply direction after initial SYN in original. 920+ */921 if (index == TCP_SYNACK_SET922 && conntrack->proto.tcp.last_index == TCP_SYN_SET923 && conntrack->proto.tcp.last_dir != dir···979 }980 case TCP_CONNTRACK_CLOSE:981 if (index == TCP_RST_SET982+ && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)983+ && conntrack->proto.tcp.last_index == TCP_SYN_SET)984+ || (!test_bit(IPS_ASSURED_BIT, &conntrack->status)985+ && conntrack->proto.tcp.last_index == TCP_ACK_SET))986 && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) {987+ /* RST sent to invalid SYN or ACK we had let trough988+ * at a) and c) above:989+ *990+ * a) SYN was in window then991+ * c) we hold a half-open connection.992+ *993+ * Delete our connection entry.994 * We skip window checking, because packet might ACK995+ * segments we ignored. */996 goto in_window;997 }998 /* Just fall trough */