librb: Fix type of dst for rb_inet_pton_sock()
This commit is contained in:
parent
8b96670079
commit
17809d2db7
14 changed files with 26 additions and 25 deletions
|
@ -243,6 +243,7 @@ make_client(struct Client *from)
|
|||
SetUnknown(client_p);
|
||||
rb_strlcpy(client_p->username, "unknown", sizeof(client_p->username));
|
||||
|
||||
printf("client_p=%p (%zu)\n", client_p, sizeof(client_p));
|
||||
return client_p;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ parse_netmask(const char *text, struct rb_sockaddr_storage *naddr, int *nb)
|
|||
return HM_HOST;
|
||||
} else
|
||||
*b = 128;
|
||||
if(rb_inet_pton_sock(ip, (struct sockaddr *)addr) > 0)
|
||||
if(rb_inet_pton_sock(ip, addr) > 0)
|
||||
return HM_IPV6;
|
||||
else
|
||||
return HM_HOST;
|
||||
|
@ -94,7 +94,7 @@ parse_netmask(const char *text, struct rb_sockaddr_storage *naddr, int *nb)
|
|||
return HM_HOST;
|
||||
} else
|
||||
*b = 32;
|
||||
if(rb_inet_pton_sock(ip, (struct sockaddr *)addr) > 0)
|
||||
if(rb_inet_pton_sock(ip, addr) > 0)
|
||||
return HM_IPV4;
|
||||
else
|
||||
return HM_HOST;
|
||||
|
|
|
@ -389,11 +389,11 @@ add_sctp_listener(int port, const char *vhost_ip1, const char *vhost_ip2, int ss
|
|||
memset(&vaddr, 0, sizeof(vaddr));
|
||||
|
||||
if (vhost_ip1 != NULL) {
|
||||
if (rb_inet_pton_sock(vhost_ip1, (struct sockaddr *)&vaddr[0]) <= 0)
|
||||
if (rb_inet_pton_sock(vhost_ip1, &vaddr[0]) <= 0)
|
||||
return;
|
||||
|
||||
if (vhost_ip2 != NULL) {
|
||||
if (rb_inet_pton_sock(vhost_ip2, (struct sockaddr *)&vaddr[1]) <= 0)
|
||||
if (rb_inet_pton_sock(vhost_ip2, &vaddr[1]) <= 0)
|
||||
return;
|
||||
} else {
|
||||
SET_SS_FAMILY(&vaddr[1], AF_UNSPEC);
|
||||
|
|
|
@ -246,7 +246,7 @@ conf_set_serverinfo_vhost(void *data)
|
|||
{
|
||||
struct rb_sockaddr_storage addr;
|
||||
|
||||
if(rb_inet_pton_sock(data, (struct sockaddr *)&addr) <= 0 || GET_SS_FAMILY(&addr) != AF_INET)
|
||||
if(rb_inet_pton_sock(data, &addr) <= 0 || GET_SS_FAMILY(&addr) != AF_INET)
|
||||
{
|
||||
conf_report_error("Invalid IPv4 address for server vhost (%s)", (char *) data);
|
||||
return;
|
||||
|
@ -261,7 +261,7 @@ conf_set_serverinfo_vhost6(void *data)
|
|||
|
||||
struct rb_sockaddr_storage addr;
|
||||
|
||||
if(rb_inet_pton_sock(data, (struct sockaddr *)&addr) <= 0 || GET_SS_FAMILY(&addr) != AF_INET6)
|
||||
if(rb_inet_pton_sock(data, &addr) <= 0 || GET_SS_FAMILY(&addr) != AF_INET6)
|
||||
{
|
||||
conf_report_error("Invalid IPv6 address for server vhost (%s)", (char *) data);
|
||||
return;
|
||||
|
@ -1357,7 +1357,7 @@ conf_set_connect_host(void *data)
|
|||
{
|
||||
struct rb_sockaddr_storage addr;
|
||||
|
||||
if(rb_inet_pton_sock(data, (struct sockaddr *)&addr) <= 0)
|
||||
if(rb_inet_pton_sock(data, &addr) <= 0)
|
||||
{
|
||||
rb_free(yy_server->connect_host);
|
||||
yy_server->connect_host = rb_strdup(data);
|
||||
|
@ -1383,7 +1383,7 @@ conf_set_connect_vhost(void *data)
|
|||
{
|
||||
struct rb_sockaddr_storage addr;
|
||||
|
||||
if(rb_inet_pton_sock(data, (struct sockaddr *)&addr) <= 0)
|
||||
if(rb_inet_pton_sock(data, &addr) <= 0)
|
||||
{
|
||||
rb_free(yy_server->bind_host);
|
||||
yy_server->bind_host = rb_strdup(data);
|
||||
|
@ -2191,7 +2191,7 @@ conf_set_opm_listen_address_both(void *data, bool ipv6)
|
|||
const char *confstr = (ipv6 ? "opm::listen_ipv6" : "opm::listen_ipv4");
|
||||
char *ip = data;
|
||||
|
||||
if(!rb_inet_pton_sock(ip, (struct sockaddr *)&addr))
|
||||
if(!rb_inet_pton_sock(ip, &addr))
|
||||
{
|
||||
conf_report_error("%s is an invalid address: %s", confstr, ip);
|
||||
return;
|
||||
|
|
|
@ -387,14 +387,14 @@ conf_connect_dns_callback(const char *result, int status, int aftype, void *data
|
|||
if(aftype == AF_INET)
|
||||
{
|
||||
if(status == 1)
|
||||
rb_inet_pton_sock(result, (struct sockaddr *)&server_p->connect4);
|
||||
rb_inet_pton_sock(result, &server_p->connect4);
|
||||
|
||||
server_p->dns_query_connect4 = 0;
|
||||
}
|
||||
else if(aftype == AF_INET6)
|
||||
{
|
||||
if(status == 1)
|
||||
rb_inet_pton_sock(result, (struct sockaddr *)&server_p->connect6);
|
||||
rb_inet_pton_sock(result, &server_p->connect6);
|
||||
|
||||
server_p->dns_query_connect6 = 0;
|
||||
}
|
||||
|
@ -418,14 +418,14 @@ conf_bind_dns_callback(const char *result, int status, int aftype, void *data)
|
|||
if(aftype == AF_INET)
|
||||
{
|
||||
if(status == 1)
|
||||
rb_inet_pton_sock(result, (struct sockaddr *)&server_p->bind4);
|
||||
rb_inet_pton_sock(result, &server_p->bind4);
|
||||
|
||||
server_p->dns_query_bind4 = 0;
|
||||
}
|
||||
else if(aftype == AF_INET6)
|
||||
{
|
||||
if(status == 1)
|
||||
rb_inet_pton_sock(result, (struct sockaddr *)&server_p->bind6);
|
||||
rb_inet_pton_sock(result, &server_p->bind6);
|
||||
|
||||
server_p->dns_query_bind6 = 0;
|
||||
}
|
||||
|
|
|
@ -372,7 +372,7 @@ check_server(const char *name, struct Client *client_p)
|
|||
|
||||
name_matched = true;
|
||||
|
||||
if(rb_inet_pton_sock(client_p->sockhost, (struct sockaddr *)&client_addr) <= 0)
|
||||
if(rb_inet_pton_sock(client_p->sockhost, &client_addr) <= 0)
|
||||
SET_SS_FAMILY(&client_addr, AF_UNSPEC);
|
||||
|
||||
if((tmp_p->connect_host && match(tmp_p->connect_host, client_p->host))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue