Version 2.1_beta10 released

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@899 e7ae566f-a301-0410-adde-c780ea21d3b5
This commit is contained in:
james 2006-02-17 07:43:32 +00:00
parent 651a01f913
commit dc46c0676f
5 changed files with 36 additions and 9 deletions

View File

@ -3,6 +3,10 @@ Copyright (C) 2002-2005 OpenVPN Solutions LLC <info@openvpn.net>
$Id$
2006.02.17 -- Version 2.1-beta10
* Fixed --port-share breakage introduced in 2.1-beta9.
2006.02.16 -- Version 2.1-beta9
* Added --port-share option for allowing OpenVPN and HTTPS

View File

@ -25,7 +25,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT([OpenVPN], [2.1_beta9], [openvpn-users@lists.sourceforge.net], [openvpn])
AC_INIT([OpenVPN], [2.1_beta10], [openvpn-users@lists.sourceforge.net], [openvpn])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR(syshead.h)

11
init.c
View File

@ -1890,8 +1890,15 @@ do_link_socket_new (struct context *c)
* bind the TCP/UDP socket
*/
static void
do_init_socket_1 (struct context *c, int mode)
do_init_socket_1 (struct context *c, const int mode)
{
unsigned int sockflags = c->options.sockflags;
#if PORT_SHARE
if (c->options.port_share_host && c->options.port_share_port)
sockflags |= SF_PORT_SHARE;
#endif
link_socket_init_phase1 (c->c2.link_socket,
c->options.local,
c->c1.remote_list,
@ -1921,7 +1928,7 @@ do_init_socket_1 (struct context *c, int mode)
c->options.mtu_discover_type,
c->options.rcvbuf,
c->options.sndbuf,
c->options.sockflags);
sockflags);
}
/*

View File

@ -884,13 +884,20 @@ socket_frame_init (const struct frame *frame, struct link_socket *sock)
if (link_socket_connection_oriented (sock))
{
#ifdef WIN32
stream_buf_init (&sock->stream_buf, &sock->reads.buf_init);
stream_buf_init (&sock->stream_buf,
&sock->reads.buf_init,
sock->sockflags,
sock->info.proto);
#else
alloc_buf_sock_tun (&sock->stream_buf_data,
frame,
false,
FRAME_HEADROOM_MARKER_READ_STREAM);
stream_buf_init (&sock->stream_buf, &sock->stream_buf_data);
stream_buf_init (&sock->stream_buf,
&sock->stream_buf_data,
sock->sockflags,
sock->info.proto);
#endif
}
}
@ -1663,7 +1670,9 @@ stream_buf_reset (struct stream_buf *sb)
void
stream_buf_init (struct stream_buf *sb,
struct buffer *buf)
struct buffer *buf,
const unsigned int sockflags,
const int proto)
{
sb->buf_init = *buf;
sb->maxlen = sb->buf_init.len;
@ -1671,7 +1680,9 @@ stream_buf_init (struct stream_buf *sb,
sb->residual = alloc_buf (sb->maxlen);
sb->error = false;
#if PORT_SHARE
sb->port_share_state = PS_ENABLED;
sb->port_share_state = ((sockflags & SF_PORT_SHARE) && (proto == PROTO_TCPv4_SERVER))
? PS_ENABLED
: PS_DISABLED;
#endif
stream_buf_reset (sb);
@ -1748,7 +1759,7 @@ stream_buf_added (struct stream_buf *sb,
{
if (!is_openvpn_protocol (&sb->buf))
{
msg (D_STREAM_ERRORS, "Non-OpenVPN protocol detected");
msg (D_STREAM_ERRORS, "Non-OpenVPN client protocol detected");
sb->port_share_state = PS_FOREIGN;
sb->error = true;
return false;

View File

@ -207,6 +207,7 @@ struct link_socket
# define SF_USE_IP_PKTINFO (1<<0)
# define SF_TCP_NODELAY (1<<1)
# define SF_PORT_SHARE (1<<2)
unsigned int sockflags;
/* for stream sockets */
@ -658,7 +659,11 @@ link_socket_set_outgoing_addr (const struct buffer *buf,
* such as TCP.
*/
void stream_buf_init (struct stream_buf *sb, struct buffer *buf);
void stream_buf_init (struct stream_buf *sb,
struct buffer *buf,
const unsigned int sockflags,
const int proto);
void stream_buf_close (struct stream_buf* sb);
bool stream_buf_added (struct stream_buf *sb, int length_added);