ocserv: addressed gcc9 warnings

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2019-09-26 18:12:26 +02:00
parent 16569dd05c
commit 708147d60a
2 changed files with 10 additions and 8 deletions

View File

@@ -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)
{
char temp[128];
char temp[256];
const char *name;
const char *value;
unsigned i;

View File

@@ -181,12 +181,13 @@ static int parse_proxy_proto_header_v1(struct worker_st *ws, char *line)
sa = (void*)&ws->remote_addr;
sa->sin_port = htons(atoi(line));
line = strchr(line, ' ');
if (line == NULL) {
next = strchr(line, ' ');
if (next == NULL) {
oclog(ws, LOG_ERR, "proxy-hdr: error parsing v1 header %s", line);
return -1;
}
line++;
line = next+1;
sa = (void*)&ws->our_addr;
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->sin6_port = htons(atoi(line));
line = strchr(line, ' ');
if (line == NULL) {
next = strchr(line, ' ');
if (next == NULL) {
oclog(ws, LOG_ERR, "proxy-hdr: error parsing v1 header %s", line);
return -1;
}
line++;
line = next+1;
sa = (void*)&ws->our_addr;
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;
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;
}