diff options
-rw-r--r-- | modules/zrtp/zrtp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/zrtp/zrtp.c b/modules/zrtp/zrtp.c index ef03d4c..cc3b2e0 100644 --- a/modules/zrtp/zrtp.c +++ b/modules/zrtp/zrtp.c @@ -28,6 +28,10 @@ */ +enum { + PRESZ = 36 /* Preamble size for TURN/STUN header */ +}; + struct menc_sess { zrtp_session_t *zrtp_session; }; @@ -225,12 +229,13 @@ static int on_send_packet(const zrtp_stream_t *stream, if (!sa_isset(&st->raddr, SA_ALL)) return zrtp_status_ok; - mb = mbuf_alloc(rtp_packet_length); + mb = mbuf_alloc(PRESZ + rtp_packet_length); if (!mb) return zrtp_status_alloc_fail; + mb->pos = PRESZ; (void)mbuf_write_mem(mb, (void *)rtp_packet, rtp_packet_length); - mb->pos = 0; + mb->pos = PRESZ; err = udp_send_helper(st->rtpsock, &st->raddr, mb, st->uh); if (err) { |