diff --git a/forward.c b/forward.c index e8d1308265f..717eb9a44fd 100644 --- a/forward.c +++ b/forward.c @@ -379,7 +379,7 @@ int forward_request( struct sip_msg* msg, struct proxy_l * p) ser_error = 0; break; - }while( get_next_su( p, &to.su, (ser_error==E_IP_BLOCKED)?0:1)==0 ); + }while( get_next_hu( p, &to, (ser_error==E_IP_BLOCKED)?0:1)==0 ); tcp_no_new_conn = 0; diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c index 2abd57e2a89..71a264a5fd1 100644 --- a/modules/dispatcher/dispatch.c +++ b/modules/dispatcher/dispatch.c @@ -186,7 +186,7 @@ int add_dest2list(int id, str uri, struct socket_info *sock, str *comsock, int s /* For DNS-Lookups */ struct proxy_l *proxy; - union sockaddr_union sau; + struct sockaddr_hu sau; /* check uri */ if(parse_uri(uri.s, uri.len, &puri)!=0 || puri.host.len>254) @@ -327,8 +327,8 @@ int add_dest2list(int id, str uri, struct socket_info *sock, str *comsock, int s LM_DBG("first gw ip addr [%s]:%d\n", ip_addr2a(&dp->ips[0]), dp->ports[0]); /* get the next available IPs from DNS */ - while (dp->ips_cntips[dp->ips_cnt], &sau); + while (dp->ips_cntips[dp->ips_cnt], &sau.su); dp->ports[dp->ips_cnt] = proxy->port; dp->protos[dp->ips_cnt] = proxy->proto; LM_DBG("additional gw ip addr [%s]:%d, proto %d\n", diff --git a/modules/drouting/routing.c b/modules/drouting/routing.c index 5a66c4fe33d..8edd4009208 100644 --- a/modules/drouting/routing.c +++ b/modules/drouting/routing.c @@ -536,7 +536,7 @@ add_dst( #define GWABUF_MAX_SIZE 512 char gwabuf[GWABUF_MAX_SIZE]; char *p; - union sockaddr_union sau; + struct sockaddr_hu sau; struct proxy_l *proxy; unsigned int sip_prefix; str gwas; @@ -678,8 +678,8 @@ add_dst( pgw->ips_no = 1; - while (pgw->ips_noips[pgw->ips_no], &sau); + while (pgw->ips_noips[pgw->ips_no], &sau.su); pgw->ports[pgw->ips_no] = proxy->port; pgw->protos[pgw->ips_no] = proxy->proto; LM_DBG("additional gw ip addr [%s]\n", diff --git a/modules/load_balancer/lb_data.c b/modules/load_balancer/lb_data.c index 1648779683b..5ce62c18b26 100644 --- a/modules/load_balancer/lb_data.c +++ b/modules/load_balancer/lb_data.c @@ -227,7 +227,7 @@ int add_lb_dsturi( struct lb_data *data, int id, int group, char *uri, struct lb_resource *res; struct sip_uri puri; struct proxy_l *proxy; - union sockaddr_union sau; + struct sockaddr_hu sau; int uri_len, attrs_len; int i; str fs_url = { NULL, 0 }; @@ -327,8 +327,8 @@ int add_lb_dsturi( struct lb_data *data, int id, int group, char *uri, LM_DBG("first dst ip addr [%s]:%d\n", ip_addr2a(&dst->ips[0]), dst->ports[0]); /* get the next available IPs from DNS */ - while (dst->ips_cntips[dst->ips_cnt], &sau); + while (dst->ips_cntips[dst->ips_cnt], &sau.su); dst->ports[dst->ips_cnt] = proxy->port; dst->protos[dst->ips_cnt] = proxy->proto; LM_DBG("additional dst ip addr [%s]:%d, proto %d\n", diff --git a/modules/proto_hep/hep.c b/modules/proto_hep/hep.c index 64cc81f7fc1..87fb36a078d 100644 --- a/modules/proto_hep/hep.c +++ b/modules/proto_hep/hep.c @@ -1733,7 +1733,7 @@ int send_hep_message(trace_message message, trace_dest dest, struct socket_info* } ret=0; break; - } while ( get_next_su( p, &to->su, 0)==0); + } while ( get_next_hu( p, to, 0)==0); free_proxy(p); pkg_free(p); diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c index 029f6e5f786..3286a6d85e6 100644 --- a/modules/sipcapture/sipcapture.c +++ b/modules/sipcapture/sipcapture.c @@ -4334,7 +4334,7 @@ static int w_hep_relay(struct sip_msg *msg) } break; - } while( get_next_su( proxy, &to.su, 0)==0 ); + } while( get_next_hu( proxy, &to, 0)==0 ); free_proxy(proxy); pkg_free(proxy); diff --git a/modules/tls_mgm/tls_lib_api.h b/modules/tls_mgm/tls_lib_api.h index 8deb61f8103..85dd77a7fba 100644 --- a/modules/tls_mgm/tls_lib_api.h +++ b/modules/tls_mgm/tls_lib_api.h @@ -29,7 +29,7 @@ /* TLS library specific conn ops */ typedef int (*tls_lib_conn_init_f)(struct tcp_connection *c, - struct tls_domain *tls_dom); + struct tls_domain *tls_dom, const struct sockaddr_hu *); typedef void (*tls_lib_conn_clean_f)(struct tcp_connection* c, struct tls_domain **tls_dom); typedef int (*tls_lib_update_fd_f)(struct tcp_connection* c, int fd); diff --git a/modules/tls_mgm/tls_mgm.c b/modules/tls_mgm/tls_mgm.c index 0cfd550fe30..cf5cc784ce4 100644 --- a/modules/tls_mgm/tls_mgm.c +++ b/modules/tls_mgm/tls_mgm.c @@ -1348,12 +1348,12 @@ static mi_response_t *tls_list(const mi_params_t *params, return NULL; } -int tls_conn_init(struct tcp_connection *c, struct tls_domain *tls_dom) +int tls_conn_init(struct tcp_connection *c, struct tls_domain *tls_dom, const struct sockaddr_hu *hu) { if (tls_library == TLS_LIB_OPENSSL) - return openssl_api.tls_conn_init(c, tls_dom); + return openssl_api.tls_conn_init(c, tls_dom, hu); else if (tls_library == TLS_LIB_WOLFSSL) - return wolfssl_api.tls_conn_init(c, tls_dom); + return wolfssl_api.tls_conn_init(c, tls_dom, hu); else { LM_CRIT("No TLS library module loaded\n"); return -1; diff --git a/modules/tls_openssl/openssl.c b/modules/tls_openssl/openssl.c index 522b6825852..f7b7bc5026d 100644 --- a/modules/tls_openssl/openssl.c +++ b/modules/tls_openssl/openssl.c @@ -57,7 +57,8 @@ static int mod_init(void); static void mod_destroy(void); /* openssl conn ops */ -int openssl_tls_conn_init(struct tcp_connection* c, struct tls_domain *tls_dom); +int openssl_tls_conn_init(struct tcp_connection* c, struct tls_domain *tls_dom, + const struct sockaddr_hu *hu); void openssl_tls_conn_clean(struct tcp_connection *c, struct tls_domain **tls_dom); int openssl_tls_update_fd(struct tcp_connection *c, int fd); diff --git a/modules/tls_wolfssl/wolfssl.c b/modules/tls_wolfssl/wolfssl.c index 242db15eaf6..6b7ce845f7e 100644 --- a/modules/tls_wolfssl/wolfssl.c +++ b/modules/tls_wolfssl/wolfssl.c @@ -58,7 +58,8 @@ static int load_tls_wolfssl(struct wolfssl_binds *binds); static int mod_init(void); static void mod_destroy(void); -int _wolfssl_tls_conn_init(struct tcp_connection* c, struct tls_domain *tls_dom); +int _wolfssl_tls_conn_init(struct tcp_connection* c, struct tls_domain *tls_dom, + const struct sockaddr_hu *hu); void _wolfssl_tls_conn_clean(struct tcp_connection *c, struct tls_domain **tls_dom); int _wolfssl_tls_update_fd(struct tcp_connection *c, int fd); diff --git a/modules/tls_wolfssl/wolfssl_conn_ops.c b/modules/tls_wolfssl/wolfssl_conn_ops.c index c6b5924832e..72b6927bc1b 100644 --- a/modules/tls_wolfssl/wolfssl_conn_ops.c +++ b/modules/tls_wolfssl/wolfssl_conn_ops.c @@ -173,7 +173,7 @@ int _wolfssl_tls_update_fd(struct tcp_connection *c, int fd) } int _wolfssl_tls_conn_init(struct tcp_connection* c, - struct tls_domain *tls_dom) + struct tls_domain *tls_dom, const struct sockaddr_hu *hu) { /* * new connection within a single process, no lock necessary diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c index 81ef1456826..085babb4208 100644 --- a/modules/tm/t_fwd.c +++ b/modules/tm/t_fwd.c @@ -855,7 +855,7 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg , } /* get next dns entry */ if ( t->uac[i].proxy==0 || - get_next_su( t->uac[i].proxy, &t->uac[i].request.dst.to.su, + get_next_hu( t->uac[i].proxy, &t->uac[i].request.dst.to, (ser_error==E_IP_BLOCKED)?0:1)!=0 ) break; t->uac[i].request.dst.proto = t->uac[i].proxy->proto; diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c index 23ddfd70323..9c56cbbbdbc 100644 --- a/modules/tm/t_reply.c +++ b/modules/tm/t_reply.c @@ -681,7 +681,7 @@ static inline int do_dns_failover(struct cell *t) uac = &t->uac[picked_branch]; /* check if the DNS resolver can get at least one new IP */ - if ( get_next_su( uac->proxy, &uac->request.dst.to.su, 1)!=0 ) + if ( get_next_hu( uac->proxy, &uac->request.dst.to, 1)!=0 ) return -1; LM_DBG("new destination available\n"); diff --git a/modules/tracer/tracer.c b/modules/tracer/tracer.c index 7af560a0d44..fbc9734ecfe 100644 --- a/modules/tracer/tracer.c +++ b/modules/tracer/tracer.c @@ -3470,7 +3470,7 @@ static int trace_send_duplicate(char *buf, int len, struct sip_uri *uri) } ret = 0; break; - }while( get_next_su( p, &to->su, 0)==0 ); + }while( get_next_hu( p, to, 0)==0 ); free_proxy(p); /* frees only p content, not p itself */ pkg_free(p); diff --git a/resolve.c b/resolve.c index 6f3abd7b2e8..6b15bfd3c4b 100644 --- a/resolve.c +++ b/resolve.c @@ -2011,7 +2011,7 @@ void free_dns_res( struct proxy_l *p ) -int get_next_su(struct proxy_l *p, union sockaddr_union* su, int add_to_bl) +int get_next_hu(struct proxy_l *p, struct sockaddr_hu* hu, int add_to_bl) { struct hostent *he; struct bl_rule *list; @@ -2035,7 +2035,7 @@ int get_next_su(struct proxy_l *p, union sockaddr_union* su, int add_to_bl) /* any more available IPs in he ? */ if ( p->host.h_addr_list[++p->addr_idx] ) { /* yes -> return the IP*/ - hostent2su( su, &p->host, p->addr_idx, (p->port)?p->port:SIP_PORT); + hostent2hu( hu, &p->host, p->addr_idx, (p->port)?p->port:SIP_PORT); return 0; } @@ -2057,7 +2057,7 @@ int get_next_su(struct proxy_l *p, union sockaddr_union* su, int add_to_bl) return -1; } - hostent2su( su, &p->host, 0, (p->port)?p->port:SIP_PORT); + hostent2hu( hu, &p->host, 0, (p->port)?p->port:SIP_PORT); p->addr_idx = 0; return 0; } diff --git a/resolve.h b/resolve.h index 3e0f0346585..f5a282eed01 100644 --- a/resolve.h +++ b/resolve.h @@ -185,7 +185,7 @@ void free_dns_res( struct proxy_l *p ); struct dns_node *dns_res_copy(struct dns_node *s); /*! \brief taked the next destination from a resolver state machine */ -int get_next_su(struct proxy_l *p, union sockaddr_union* su, int add_to_bl); +int get_next_hu(struct proxy_l *p, struct sockaddr_hu* su, int add_to_bl); int resolv_init();