mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
proxyproto: corrected address type setting in our address
This commit is contained in:
@@ -217,6 +217,7 @@ int parse_proxy_proto_header(struct worker_st *ws, int fd)
|
||||
|
||||
memset(&ws->our_addr, 0, sizeof(ws->our_addr));
|
||||
sa = (void*)&ws->our_addr;
|
||||
sa->sin_family = AF_INET;
|
||||
memcpy(&sa->sin_addr, p+4, 4);
|
||||
memcpy(&sa->sin_port, p+10, 2);
|
||||
ws->our_addr_len = sizeof(struct sockaddr_in);
|
||||
@@ -239,6 +240,7 @@ int parse_proxy_proto_header(struct worker_st *ws, int fd)
|
||||
ws->remote_addr_len = sizeof(struct sockaddr_in6);
|
||||
|
||||
memset(&ws->our_addr, 0, sizeof(ws->our_addr));
|
||||
sa->sin6_family = AF_INET6;
|
||||
sa = (void*)&ws->our_addr;
|
||||
memcpy(&sa->sin6_addr, p+16, 16);
|
||||
memcpy(&sa->sin6_port, p+34, 2);
|
||||
|
||||
Reference in New Issue
Block a user