Explorar el Código

nathelper: force socket if set

This fixes force socket in that it will always be forced and not
only when there is no socket.
Timmo Verlaan hace 8 años
padre
commit
b2ade6ca35
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      modules/nathelper/nathelper.c

+ 5 - 2
modules/nathelper/nathelper.c

@@ -2079,9 +2079,12 @@ nh_timer(unsigned int ticks, void *timer_idx)
 		}
 		}
 		init_dest_info(&dst);
 		init_dest_info(&dst);
 		hostent2su(&dst.to, he, 0, curi.port_no);
 		hostent2su(&dst.to, he, 0, curi.port_no);
+
+		if (force_socket) {
+			send_sock = force_socket;
+		}
 		if (send_sock==0) {
 		if (send_sock==0) {
-			send_sock=force_socket ? force_socket :
-				get_send_socket(0, &dst.to, PROTO_UDP);
+			send_sock = get_send_socket(0, &dst.to, PROTO_UDP);
 		}
 		}
 		if (send_sock == NULL) {
 		if (send_sock == NULL) {
 			LM_ERR("can't get sending socket\n");
 			LM_ERR("can't get sending socket\n");