get MAX_PORT_STR_LEN constant from fko_message.h

This commit is contained in:
Michael Rash
2012-08-31 23:05:05 -04:00
parent dafcfbc488
commit 1548cbafc8
4 changed files with 4 additions and 4 deletions

View File

@@ -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);

View File

@@ -28,6 +28,7 @@
*
*****************************************************************************
*/
#include "fwknop_common.h"
#include "utils.h"
/* Generic hex dump function.

View File

@@ -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

View File

@@ -33,6 +33,7 @@
#include <time.h>
#include "fko_limits.h"
#include "fko_message.h"
#ifdef __cplusplus
extern "C" {