[sr-dev] git:master:2fb84e5e: nathelper: moved var declaration into the begining of function.

Konstantin Poliakov k.polyakov at mightycall.com
Wed May 2 08:13:13 CEST 2018


Module: kamailio
Branch: master
Commit: 2fb84e5e101b61bbaedc18d8b37188cbc6b1cee8
URL: https://github.com/kamailio/kamailio/commit/2fb84e5e101b61bbaedc18d8b37188cbc6b1cee8

Author: Konstantin Poliakov <k.polyakov at mightycall.com>
Committer: Konstantin Poliakov <k.polyakov at mightycall.com>
Date: 2018-04-30T23:57:19+03:00

nathelper: moved var declaration into the begining of function.

---

Modified: src/modules/nathelper/nathelper.c

---

Diff:  https://github.com/kamailio/kamailio/commit/2fb84e5e101b61bbaedc18d8b37188cbc6b1cee8.diff
Patch: https://github.com/kamailio/kamailio/commit/2fb84e5e101b61bbaedc18d8b37188cbc6b1cee8.patch

---

diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c
index 953384265a..5382d4c6b8 100644
--- a/src/modules/nathelper/nathelper.c
+++ b/src/modules/nathelper/nathelper.c
@@ -1921,6 +1921,7 @@ static void nh_timer(unsigned int ticks, void *timer_idx)
 	unsigned int path_ip = 0;
 	unsigned short path_port = 0;
 	int options = 0;
+	int should_send_ping = 0;
 
 	if((*natping_state) == 0)
 		goto done;
@@ -2059,7 +2060,7 @@ static void nh_timer(unsigned int ticks, void *timer_idx)
 		dst.proto = PROTO_UDP;
 		dst.send_sock = send_sock;
 
-		int should_send_ping = (flags & sipping_flag) != 0 || ping_nated_only == 0;
+		should_send_ping = (flags & sipping_flag) != 0 || ping_nated_only == 0;
 
 		if ( should_send_ping && (opt.s = build_sipping(&c, send_sock, &path, &ruid, aorhash, &opt.len)) != 0) {
 			if(udp_send(&dst, opt.s, opt.len) < 0) {




More information about the sr-dev mailing list