From 272242f4761c6623e3e585d5f5c15396cbf90aa6 Mon Sep 17 00:00:00 2001 From: Richard Aas Date: Tue, 27 Oct 2015 11:59:09 +0000 Subject: [PATCH] stun keepalive: handle method BINDING only --- src/stun/keepalive.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/stun/keepalive.c b/src/stun/keepalive.c index 37c9a94..f7337a4 100644 --- a/src/stun/keepalive.c +++ b/src/stun/keepalive.c @@ -135,6 +135,12 @@ static bool udp_recv_handler(struct sa *src, struct mbuf *mb, void *arg) if (stun_msg_decode(&msg, mb, &ua)) return false; + if (stun_msg_method(msg) != STUN_METHOD_BINDING) { + hdld = false; + mb->pos = pos; + goto out; + } + switch (stun_msg_class(msg)) { case STUN_CLASS_ERROR_RESP: @@ -149,6 +155,7 @@ static bool udp_recv_handler(struct sa *src, struct mbuf *mb, void *arg) break; } + out: mem_deref(msg); return hdld;