瀏覽代碼

nathelper: moved var declaration into the begining of function.

Konstantin Poliakov 7 年之前
父節點
當前提交
2fb84e5e10
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/modules/nathelper/nathelper.c

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