Skip to content

Commit 285c27b

Browse files
committed
janus: fixed compatibility with Tailscale MTU
1 parent 5331ae1 commit 285c27b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

janus/src/rtp.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727

2828
// Max RTP size for WebRTC is 1200 bytes:
2929
// - https://stackoverflow.com/questions/47635545/why-webrtc-chose-rtp-max-packet-size-to-1200-bytes
30-
// We take this and substract 50 bytes for possible RTP extensions, see sdp.c
31-
#define US_RTP_TOTAL_SIZE (1200 - 50)
30+
// But(!) Tailscale has 1200 MTU. So to fit it required to substract:
31+
// 1. possible RTP extensions (see sdp.c)
32+
// 2. additional SRTP fields (>= 10 bytes)
33+
// 3. additional IPv6 fields (40 bytes)
34+
// Finally it looks like 100 bytes for all above should be enough
35+
#define US_RTP_TOTAL_SIZE (1200 - 100)
3236
#define US_RTP_HEADER_SIZE 12
3337
#define US_RTP_PAYLOAD_SIZE (US_RTP_TOTAL_SIZE - US_RTP_HEADER_SIZE)
3438

0 commit comments

Comments
 (0)