From: james Date: Wed, 8 Nov 2006 01:05:19 +0000 (+0000) Subject: PROTO_TCPv4 is never used as an index into X-Git-Tag: v2.1_rc2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1406db559be5030c7c4cb8ee2a424e61faafd130;p=thirdparty%2Fopenvpn.git PROTO_TCPv4 is never used as an index into proto_overhead, however this should be fixed. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1434 e7ae566f-a301-0410-adde-c780ea21d3b5 --- diff --git a/socket.c b/socket.c index a37229536..70d8ffd87 100644 --- a/socket.c +++ b/socket.c @@ -41,6 +41,13 @@ #include "memdbg.h" +const int proto_overhead[] = { /* indexed by PROTO_x */ + IPv4_UDP_HEADER_SIZE, + IPv4_TCP_HEADER_SIZE, + IPv4_TCP_HEADER_SIZE, + IPv4_TCP_HEADER_SIZE +}; + /* * Functions related to the translation of DNS names to IP addresses. */ diff --git a/socket.h b/socket.h index f0d9a4374..28bf41f8b 100644 --- a/socket.h +++ b/socket.h @@ -454,11 +454,7 @@ int proto_remote (int proto, bool remote); #define IPv4_TCP_HEADER_SIZE 40 #define IPv6_UDP_HEADER_SIZE 40 -static const int proto_overhead[] = { /* indexed by PROTO_x */ - IPv4_UDP_HEADER_SIZE, - IPv4_TCP_HEADER_SIZE, - IPv4_TCP_HEADER_SIZE -}; +extern const int proto_overhead[]; static inline int datagram_overhead (int proto)