Module: kamailio
Branch: master
Commit: 449d435194338a4f3acf079774adcbef7ad7b794
URL:
https://github.com/kamailio/kamailio/commit/449d435194338a4f3acf079774adcbe…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-22T08:34:01+02:00
nat_traversal: handle return values for errors
---
Modified: src/modules/nat_traversal/nat_traversal.c
---
Diff:
https://github.com/kamailio/kamailio/commit/449d435194338a4f3acf079774adcbe…
Patch:
https://github.com/kamailio/kamailio/commit/449d435194338a4f3acf079774adcbe…
---
diff --git a/src/modules/nat_traversal/nat_traversal.c
b/src/modules/nat_traversal/nat_traversal.c
index 8bd4adde65..d3c6c95057 100644
--- a/src/modules/nat_traversal/nat_traversal.c
+++ b/src/modules/nat_traversal/nat_traversal.c
@@ -1573,6 +1573,10 @@ send_keepalive(NAT_Contact *contact)
lport = 0;
lproto = PROTO_NONE;
hostent = sip_resolvehost(&nat_ip, &lport, &lproto);
+ if(hostent==NULL) {
+ LM_ERR("sip resolve host failed\n");
+ return;
+ }
hostent2su(&dst.to, hostent, 0, nat_port);
dst.proto=PROTO_UDP;
dst.send_sock=contact->socket;
@@ -1900,7 +1904,9 @@ reply_filter(struct sip_msg *reply)
static str prefix = {NULL, 0};
str call_id;
- parse_headers(reply, HDR_VIA2_F, 0);
+ if(parse_headers(reply, HDR_VIA2_F, 0)<0) {
+ LM_DBG("second via not parsed\n");
+ }
if (reply->via2)
return 1;