forked from aniani/gmnisrv
Fix size of in{,6}_addr
This commit is contained in:
parent
814a6e7657
commit
534efe8e34
@ -48,14 +48,14 @@ server_init(struct gmnisrv_server *server, struct gmnisrv_config *conf)
|
||||
if (b->family == AF_INET) {
|
||||
struct sockaddr_in in = {0};
|
||||
in.sin_family = AF_INET;
|
||||
memcpy(&in.sin_addr, b->addr, sizeof(b->addr));
|
||||
memcpy(&in.sin_addr, b->addr, sizeof(struct in_addr));
|
||||
in.sin_port = htons(b->port);
|
||||
addr = (struct sockaddr *)∈
|
||||
addrsz = sizeof(in);
|
||||
} else if (b->family == AF_INET6) {
|
||||
struct sockaddr_in6 in = {0};
|
||||
in.sin6_family = AF_INET6;
|
||||
memcpy(&in.sin6_addr, b->addr, sizeof(b->addr));
|
||||
memcpy(&in.sin6_addr, b->addr, sizeof(struct in6_addr));
|
||||
in.sin6_port = htons(b->port);
|
||||
addr = (struct sockaddr *)∈
|
||||
addrsz = sizeof(in);
|
||||
|
Loading…
Reference in New Issue
Block a user