Skip to content

Commit

Permalink
Fix connection's expect cid.
Browse files Browse the repository at this point in the history
Replace combination of generator using cid and other peers support cid
by the fixed expect cid.

Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
  • Loading branch information
Achim Kraus committed Feb 27, 2021
1 parent e00f9c7 commit 5789725
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,6 @@ public void processRecord(Record record, Connection connection) {
return;
}

boolean useCid = connectionIdGenerator != null && connectionIdGenerator.useConnectionId();
if (record.getType() == ContentType.TLS12_CID) {
// !useCid already dropped in Record.fromByteArray
if (epoch == 0) {
Expand All @@ -1472,7 +1471,7 @@ public void processRecord(Record record, Connection connection) {
}
return;
}
} else if (epoch > 0 && useCid && connection.expectCid()) {
} else if (epoch > 0 && connection.expectCid()) {
DROP_LOGGER.debug("Discarding record received from peer [{}], CID required!", record.getPeerAddress());
if (health != null) {
health.receivingRecord(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public SessionTicket getSessionTicket() {
*/
public boolean expectCid() {
DTLSSession session = getSession();
return session != null && session.getWriteConnectionId() != null;
return session != null && session.getReadConnectionId() != null && !session.getReadConnectionId().isEmpty();
}

/**
Expand Down

0 comments on commit 5789725

Please sign in to comment.