Skip to content

Commit 4ec70ca

Browse files
syzzercron2
authored andcommitted
Account for peer-id in frame size calculation
Data channel packet using P_DATA_V2 will use three bytes extra for the peer-id. This needs to be accounted for, otherwise OpenVPN will throw TCP/UDP packet too large on write to [AF_INET]10.1.1.1:1194 warnings. Signed-off-by: Steffan Karger <[email protected]> Acked-by: Lev Stipakov <[email protected]> Message-Id: <[email protected]> URL: http://article.gmane.org/gmane.network.openvpn.devel/9418 Signed-off-by: Gert Doering <[email protected]> (cherry picked from commit f95010a)
1 parent b6dc199 commit 4ec70ca

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/openvpn/ssl.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,14 @@ tls_get_cipher_name_pair (const char * cipher_name, size_t len) {
267267
return NULL;
268268
}
269269

270-
/*
271-
* Max number of bytes we will add
272-
* for data structures common to both
273-
* data and control channel packets.
274-
* (opcode only).
270+
/**
271+
* Max number of bytes we will add for data structures common to both data and
272+
* control channel packets (1 byte opcode + 3 bytes peer-id).
275273
*/
276274
void
277275
tls_adjust_frame_parameters(struct frame *frame)
278276
{
279-
frame_add_to_extra_frame (frame, 1); /* space for opcode */
277+
frame_add_to_extra_frame (frame, 1 + 3); /* space for opcode + peer-id */
280278
}
281279

282280
/*

0 commit comments

Comments
 (0)