Module: kamailio
Branch: 5.1
Commit: 6bf6cfbb90c3fd29cb0c5c079b0eef44892690bf
URL:
https://github.com/kamailio/kamailio/commit/6bf6cfbb90c3fd29cb0c5c079b0eef4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-21T08:29:56+02:00
core: raw sock - reset the rcv_msg and proper test for totlen
(cherry picked from commit 145e3a1e461dd53fb1e06bae619d20a09dcffe75)
---
Modified: src/core/raw_sock.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6bf6cfbb90c3fd29cb0c5c079b0eef4…
Patch:
https://github.com/kamailio/kamailio/commit/6bf6cfbb90c3fd29cb0c5c079b0eef4…
---
diff --git a/src/core/raw_sock.c b/src/core/raw_sock.c
index a8beb6691e..9dd65d2340 100644
--- a/src/core/raw_sock.c
+++ b/src/core/raw_sock.c
@@ -228,6 +228,7 @@ int recvpkt4(int sock, char* buf, int len, union sockaddr_union*
from,
iov[0].iov_base=buf;
iov[0].iov_len=len;
+ memset(&rcv_msg, 0, sizeof(struct msghdr));
rcv_msg.msg_name=from;
rcv_msg.msg_namelen=sockaddru_len(*from);
rcv_msg.msg_control=msg_ctrl_buf;
@@ -603,7 +604,7 @@ int raw_iphdr_udp4_send(int rsock, char* buf, unsigned int len,
int ret;
totlen = len + sizeof(hdr);
- if (unlikely(totlen) > 65535)
+ if (unlikely(totlen > 65535))
return -2;
memset(&snd_msg, 0, sizeof(snd_msg));
snd_msg.msg_name=&to->sin;