Skip to content

Commit 3e13469

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
Pablo Niera Ayuso says: ==================== The following patchset contains Netfilter fixes for net: 1) Fix syn-retransmits until initiator gives up when connection is re-used due to rst marked as invalid, from Florian Westphal. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 010a74f + c410cb9 commit 3e13469

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

net/netfilter/nf_conntrack_proto_tcp.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,13 @@ int nf_conntrack_tcp_packet(struct nf_conn *ct,
10681068
ct->proto.tcp.last_flags |=
10691069
IP_CT_EXP_CHALLENGE_ACK;
10701070
}
1071+
1072+
/* possible challenge ack reply to syn */
1073+
if (old_state == TCP_CONNTRACK_SYN_SENT &&
1074+
index == TCP_ACK_SET &&
1075+
dir == IP_CT_DIR_REPLY)
1076+
ct->proto.tcp.last_ack = ntohl(th->ack_seq);
1077+
10711078
spin_unlock_bh(&ct->lock);
10721079
nf_ct_l4proto_log_invalid(skb, ct, state,
10731080
"packet (index %d) in dir %d ignored, state %s",
@@ -1193,6 +1200,14 @@ int nf_conntrack_tcp_packet(struct nf_conn *ct,
11931200
* segments we ignored. */
11941201
goto in_window;
11951202
}
1203+
1204+
/* Reset in response to a challenge-ack we let through earlier */
1205+
if (old_state == TCP_CONNTRACK_SYN_SENT &&
1206+
ct->proto.tcp.last_index == TCP_ACK_SET &&
1207+
ct->proto.tcp.last_dir == IP_CT_DIR_REPLY &&
1208+
ntohl(th->seq) == ct->proto.tcp.last_ack)
1209+
goto in_window;
1210+
11961211
break;
11971212
default:
11981213
/* Keep compilers happy. */

0 commit comments

Comments
 (0)