mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
ocserv: addressed gcc9 warnings
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
@@ -170,7 +170,7 @@ static int append_group_idx(worker_st * ws, str_st *str, unsigned i)
|
|||||||
|
|
||||||
static int append_group_str(worker_st * ws, str_st *str, const char *group)
|
static int append_group_str(worker_st * ws, str_st *str, const char *group)
|
||||||
{
|
{
|
||||||
char temp[128];
|
char temp[256];
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *value;
|
const char *value;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|||||||
@@ -181,12 +181,13 @@ static int parse_proxy_proto_header_v1(struct worker_st *ws, char *line)
|
|||||||
sa = (void*)&ws->remote_addr;
|
sa = (void*)&ws->remote_addr;
|
||||||
sa->sin_port = htons(atoi(line));
|
sa->sin_port = htons(atoi(line));
|
||||||
|
|
||||||
line = strchr(line, ' ');
|
next = strchr(line, ' ');
|
||||||
if (line == NULL) {
|
if (next == NULL) {
|
||||||
oclog(ws, LOG_ERR, "proxy-hdr: error parsing v1 header %s", line);
|
oclog(ws, LOG_ERR, "proxy-hdr: error parsing v1 header %s", line);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
line++;
|
|
||||||
|
line = next+1;
|
||||||
|
|
||||||
sa = (void*)&ws->our_addr;
|
sa = (void*)&ws->our_addr;
|
||||||
sa->sin_port = htons(atoi(line));
|
sa->sin_port = htons(atoi(line));
|
||||||
@@ -236,12 +237,13 @@ static int parse_proxy_proto_header_v1(struct worker_st *ws, char *line)
|
|||||||
sa = (void*)&ws->remote_addr;
|
sa = (void*)&ws->remote_addr;
|
||||||
sa->sin6_port = htons(atoi(line));
|
sa->sin6_port = htons(atoi(line));
|
||||||
|
|
||||||
line = strchr(line, ' ');
|
next = strchr(line, ' ');
|
||||||
if (line == NULL) {
|
if (next == NULL) {
|
||||||
oclog(ws, LOG_ERR, "proxy-hdr: error parsing v1 header %s", line);
|
oclog(ws, LOG_ERR, "proxy-hdr: error parsing v1 header %s", line);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
line++;
|
|
||||||
|
line = next+1;
|
||||||
|
|
||||||
sa = (void*)&ws->our_addr;
|
sa = (void*)&ws->our_addr;
|
||||||
sa->sin6_port = htons(atoi(line));
|
sa->sin6_port = htons(atoi(line));
|
||||||
@@ -392,7 +394,7 @@ int parse_proxy_proto_header(struct worker_st *ws, int fd)
|
|||||||
struct sockaddr_in6 *sa = (void*)&ws->remote_addr;
|
struct sockaddr_in6 *sa = (void*)&ws->remote_addr;
|
||||||
|
|
||||||
if (data_size < 36) {
|
if (data_size < 36) {
|
||||||
oclog(ws, LOG_INFO, "proxy-hdr: received not enough IPv6 data");
|
oclog(ws, LOG_INFO, "proxy-hdr: did not receive enough IPv6 data");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user