Module: kamailio
Branch: master
Commit: 145e3a1e461dd53fb1e06bae619d20a09dcffe75
URL:
https://github.com/kamailio/kamailio/commit/145e3a1e461dd53fb1e06bae619d20a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-15T11:50:31+02:00
core: raw sock - reset the rcv_msg and proper test for totlen
---
Modified: src/core/raw_sock.c
---
Diff:
https://github.com/kamailio/kamailio/commit/145e3a1e461dd53fb1e06bae619d20a…
Patch:
https://github.com/kamailio/kamailio/commit/145e3a1e461dd53fb1e06bae619d20a…
---
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;