get MAX_PORT_STR_LEN constant from fko_message.h
This commit is contained in:
@@ -118,7 +118,7 @@ send_spa_packet_tcp_or_udp(const char *spa_data, const int sd_len,
|
||||
{
|
||||
int sock, res=0, error;
|
||||
struct addrinfo *result, *rp, hints;
|
||||
char port_str[MAX_PORT_STR_LEN];
|
||||
char port_str[MAX_PORT_STR_LEN+1];
|
||||
|
||||
if (options->test)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ send_spa_packet_tcp_or_udp(const char *spa_data, const int sd_len,
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
}
|
||||
|
||||
snprintf(port_str, MAX_PORT_STR_LEN, "%d", options->spa_dst_port);
|
||||
snprintf(port_str, MAX_PORT_STR_LEN+1, "%d", options->spa_dst_port);
|
||||
|
||||
error = getaddrinfo(options->spa_server_str, port_str, &hints, &result);
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
#include "fwknop_common.h"
|
||||
#include "utils.h"
|
||||
|
||||
/* Generic hex dump function.
|
||||
|
||||
@@ -102,8 +102,6 @@ enum {
|
||||
#define DEFAULT_NAT_PORT 55000
|
||||
#define MIN_HIGH_PORT 10000 /* sensible minimum for SPA dest port */
|
||||
#define MAX_PORT 65535
|
||||
#define MAX_PORT_STR_LEN 6
|
||||
#define MAX_PROTO_STR_LEN 6
|
||||
#define MAX_SERVER_STR_LEN 50
|
||||
|
||||
#define MAX_LINE_LEN 1024
|
||||
|
||||
Reference in New Issue
Block a user