Ver Fonte

Merge pull request #847 from tverlaan/nathelper_force_socket

nathelper: force socket if set
Daniel-Constantin Mierla há 8 anos atrás
pai
commit
a25d17748a
1 ficheiros alterados com 5 adições e 2 exclusões
  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);
 		hostent2su(&dst.to, he, 0, curi.port_no);
+
+		if (force_socket) {
+			send_sock = force_socket;
+		}
 		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) {
 			LM_ERR("can't get sending socket\n");