2
0
Эх сурвалжийг харах

nathelper: moved var declaration into the begining of function.

Konstantin Poliakov 7 жил өмнө
parent
commit
2fb84e5e10

+ 2 - 1
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) {