0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-15 22:41:12 +01:00

stupidity fixes

This commit is contained in:
Elizabeth Myers 2016-03-23 19:06:33 -05:00
parent 6cd3964de7
commit 32f8c78b55
2 changed files with 8 additions and 8 deletions

View file

@ -205,25 +205,25 @@ static void start_auth(const char *cid, const char *l_ip, const char *l_port, co
rb_strlcpy(auth->l_ip, l_ip, sizeof(auth->l_ip));
auth->l_port = (uint16_t)atoi(l_port); /* should be safe */
(void) rb_inet_pton_sock(l_ip, (struct sockaddr *)&auth->l_addr, sizeof(auth->l_addr));
(void) rb_inet_pton_sock(l_ip, (struct sockaddr *)&auth->l_addr);
rb_strlcpy(auth->c_ip, c_ip, sizeof(auth->c_ip));
auth->c_port = (uint16_t)atoi(c_port);
(void) rb_inet_pton_sock(c_ip, (struct sockaddr *)&auth->c_addr, sizeof(auth->c_addr));
(void) rb_inet_pton_sock(c_ip, (struct sockaddr *)&auth->c_addr);
#ifdef RB_IPV6
if(GET_SS_FAMILY(&auth->l_addr) == AF_INET6)
((struct sockaddr_in6 *)&l_addr)->sin6_port = htons(auth->l_port);
((struct sockaddr_in6 *)&auth->l_addr)->sin6_port = htons(auth->l_port);
else
#endif
((struct sockaddr_in *)&l_addr)->sin_port = htons(auth->l_port);
((struct sockaddr_in *)&auth->l_addr)->sin_port = htons(auth->l_port);
#ifdef RB_IPV6
if(GET_SS_FAMILY(&auth->c_addr) == AF_INET6)
((struct sockaddr_in6 *)&c_addr)->sin6_port = htons(auth->c_port);
((struct sockaddr_in6 *)&auth->c_addr)->sin6_port = htons(auth->c_port);
else
#endif
((struct sockaddr_in *)&c_addr)->sin_port = htons(auth->c_port);
((struct sockaddr_in *)&auth->c_addr)->sin_port = htons(auth->c_port);
rb_dictionary_add(auth_clients, RB_UINT_TO_POINTER(auth->cid), auth);

View file

@ -97,8 +97,8 @@ bool ident_start(struct auth_client *auth)
query->F = F;
/* Build sockaddr_storages for rb_connect_tcp below */
memcpy(&l_addr, auth->l_addr, sizeof(l_addr));
memcpy(&c_addr, auth->c_addr, sizeof(c_addr));
memcpy(&l_addr, &auth->l_addr, sizeof(l_addr));
memcpy(&c_addr, &auth->c_addr, sizeof(c_addr));
/* Set the ports correctly */
#ifdef RB_IPV6