Skip to contentSkip to conversation

netfilter: conntrack: allow sctp hearbeat after connection re-use

PATCH Superseded Florian Westphal 1 participant 1 message Aug 14, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: conntrack: allow sctp hearbeat after connection re-use

If an sctp connection gets re-used, heartbeats are flagged as invalid because their vtag doesn't match.

Handle this in a similar way as TCP conntrack when it suspects that the endpoints and conntrack are out-of-sync.

When a HEARTBEAT request fails its vtag validation, flag this in the conntrack state and accept the packet.

When a HEARTBEAT_ACK is received with an invalid vtag in the reverse direction after we allowed such a HEARTBEAT through, assume we are out-of-sync and re-set the vtag info.

---
 include/linux/netfilter/nf_conntrack_sctp.h |  2 +
 net/netfilter/nf_conntrack_proto_sctp.c     | 43 ++++++++++++++++++---
 2 files changed, 39 insertions(+), 6 deletions(-)
include/linux/netfilter/nf_conntrack_sctp.h +2 -0
index 9a33f171aa82..625f491b95de 100644
@@ -9,6 +9,8 @@ struct ip_ct_sctp {
 	enum sctp_conntrack state;
 
 	__be32 vtag[IP_CT_DIR_MAX];
+	u8 last_dir;
+	u8 flags;
 };
 
 #endif /* _NF_CONNTRACK_SCTP_H */
net/netfilter/nf_conntrack_proto_sctp.c +37 -6

82 lines not on this page · raw message

Signature · 1 line
2.26.2