Re: [Openvpn-devel] [PATCH] Made some options connection-entry specific

2012-02-13 Thread David Sommerseth
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/02/12 16:29, Jan Just Keijser wrote:
> Made some options connection-entry specific: fragment mssfix tun-mtu 
> tun-mtu-extra link-mtu mtu_discover_type explicit-exit-notification
> in order to support stuff like  remote host proto udp 
> fragment explicit-exit-notification 3   
> remote host proto tcp 
> 
> Signed-off-by: Jan Just Keijser  --- forward.c | 2
> +- init.c|   38 ++- occ.c |2 +- options.c
> |  125 +++-- 
> options.h |   36 +- sig.c |6 +- 6 files 
> changed, 107 insertions(+), 102 deletions(-)

ACK.  Applied to the master branch for -stable and -testing trees.

commit 76809cae0eae07817160b423d3f9551df1a1d68e
Author: Jan Just Keijser 
List-Post: openvpn-devel@lists.sourceforge.net
Date:   Tue Feb 7 16:29:47 2012 +0100

Made some options connection-entry specific

Signed-off-by: Jan Just Keijser 
Acked-by: David Sommerseth 
Signed-off-by: David Sommerseth 


kind regards,

David Sommerseth



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk85atQACgkQDC186MBRfrpRcACeOAUc3CWM1ORg2hWBDSwwS4hQ
4B8AoK8lWaZQKO5m589P3TgjUB2IE9/v
=meS6
-END PGP SIGNATURE-



Re: [Openvpn-devel] [PATCH] Made some options connection-entry specific

2012-02-07 Thread Jan Just Keijser
sorry about the noise, folks; this was my second git patch attempt :)

cheers,

JJK


Jan Just Keijser wrote:
> Made some options connection-entry specific:
>  fragment  
>  mssfix
>  tun-mtu
>  tun-mtu-extra
>  link-mtu  
>  mtu_discover_type
>  explicit-exit-notification
> in order to support stuff like
> 
>   remote host
>   proto udp
>   fragment  
>   explicit-exit-notification 3
> 
>  
>   remote host 
>   proto tcp
> 
>
> Signed-off-by: Jan Just Keijser 
> ---
>  forward.c |2 +-
>  init.c|   38 ++-
>  occ.c |2 +-
>  options.c |  125 
> +++--
>  options.h |   36 +-
>  sig.c |6 +-
>  6 files changed, 107 insertions(+), 102 deletions(-)
>
> diff --git a/forward.c b/forward.c
> index dfef4ef..96c6b9a 100644
> --- a/forward.c
> +++ b/forward.c
> @@ -1005,7 +1005,7 @@ process_incoming_tun (struct context *c)
>  void
>  process_ipv4_header (struct context *c, unsigned int flags, struct buffer 
> *buf)
>  {
> -  if (!c->options.mssfix)
> +  if (!c->options.ce.mssfix)
>  flags &= ~PIPV4_MSSFIX;
>  #if PASSTOS_CAPABILITY
>if (!c->options.passtos)
> diff --git a/init.c b/init.c
> index 51b0d64..8f42120 100644
> --- a/init.c
> +++ b/init.c
> @@ -1786,10 +1786,10 @@ do_deferred_options (struct context *c, const 
> unsigned int found)
>  #ifdef ENABLE_OCC
>if (found & OPT_P_EXPLICIT_NOTIFY)
>  {
> -  if (!proto_is_udp(c->options.ce.proto) && 
> c->options.explicit_exit_notification)
> +  if (!proto_is_udp(c->options.ce.proto) && 
> c->options.ce.explicit_exit_notification)
>   {
> msg (D_PUSH, "OPTIONS IMPORT: --explicit-exit-notify can only be used 
> with --proto udp");
> -   c->options.explicit_exit_notification = 0;
> +   c->options.ce.explicit_exit_notification = 0;
>   }
>else
>   msg (D_PUSH, "OPTIONS IMPORT: explicit notify parm(s) modified");
> @@ -1962,10 +1962,10 @@ frame_finalize_options (struct context *c, const 
> struct options *o)
>  }
>
>frame_finalize (&c->c2.frame,
> -   o->link_mtu_defined,
> -   o->link_mtu,
> -   o->tun_mtu_defined,
> -   o->tun_mtu);
> +   o->ce.link_mtu_defined,
> +   o->ce.link_mtu,
> +   o->ce.tun_mtu_defined,
> +   o->ce.tun_mtu);
>  }
>  
>  /*
> @@ -2411,8 +2411,8 @@ do_init_frame (struct context *c)
>/*
> * Adjust frame size based on the --tun-mtu-extra parameter.
> */
> -  if (c->options.tun_mtu_extra_defined)
> -tun_adjust_frame_parameters (&c->c2.frame, c->options.tun_mtu_extra);
> +  if (c->options.ce.tun_mtu_extra_defined)
> +tun_adjust_frame_parameters (&c->c2.frame, c->options.ce.tun_mtu_extra);
>  
>/*
> * Adjust frame size based on link socket parameters.
> @@ -2441,13 +2441,13 @@ do_init_frame (struct context *c)
>/*
> * MTU advisories
> */
> -  if (c->options.fragment && c->options.mtu_test)
> +  if (c->options.ce.fragment && c->options.mtu_test)
>  msg (M_WARN,
>"WARNING: using --fragment and --mtu-test together may produce an 
> inaccurate MTU test result");
>  #endif
>  
>  #ifdef ENABLE_FRAGMENT
> -  if ((c->options.mssfix || c->options.fragment)
> +  if ((c->options.ce.mssfix || c->options.ce.fragment)
>&& TUN_MTU_SIZE (&c->c2.frame_fragment) != ETHERNET_MTU)
>  msg (M_WARN,
>"WARNING: normally if you use --mssfix and/or --fragment, you should 
> also set --tun-mtu %d (currently it is %d)",
> @@ -2619,9 +2619,9 @@ do_init_buffers (struct context *c)
>  static void
>  do_init_fragment (struct context *c)
>  {
> -  ASSERT (c->options.fragment);
> +  ASSERT (c->options.ce.fragment);
>frame_set_mtu_dynamic (&c->c2.frame_fragment,
> -  c->options.fragment, SET_MTU_UPPER_BOUND);
> +  c->options.ce.fragment, SET_MTU_UPPER_BOUND);
>fragment_frame_init (c->c2.fragment, &c->c2.frame_fragment);
>  }
>  #endif
> @@ -2632,10 +2632,10 @@ do_init_fragment (struct context *c)
>  static void
>  do_init_mssfix (struct context *c)
>  {
> -  if (c->options.mssfix)
> +  if (c->options.ce.mssfix)
>  {
>frame_set_mtu_dynamic (&c->c2.frame,
> -  c->options.mssfix, SET_MTU_UPPER_BOUND);
> +  c->options.ce.mssfix, SET_MTU_UPPER_BOUND);
>  }
>  }
>  
> @@ -2691,7 +2691,7 @@ do_init_socket_1 (struct context *c, const int mode)
>  c->options.ce.connect_retry_seconds,
>  c->options.ce.connect_timeout,
>  c->options.ce.connect_retry_max,
> -c->options.mtu_discover_type,
> +c->options.ce.mtu_discover_type,
>  c->options.rcvbuf,
>  c->options.sndbuf,
>  c->options.mark,
> @@ -3406,7 +3408,7 @@ init_instance (struct context *c, const struct 

[Openvpn-devel] [PATCH] Made some options connection-entry specific

2012-02-07 Thread Jan Just Keijser
Made some options connection-entry specific:
 fragment  
 mssfix
 tun-mtu
 tun-mtu-extra
 link-mtu  
 mtu_discover_type
 explicit-exit-notification
in order to support stuff like

  remote host
  proto udp
  fragment  
  explicit-exit-notification 3

 
  remote host 
  proto tcp


Signed-off-by: Jan Just Keijser 
---
 forward.c |2 +-
 init.c|   38 ++-
 occ.c |2 +-
 options.c |  125 +++--
 options.h |   36 +-
 sig.c |6 +-
 6 files changed, 107 insertions(+), 102 deletions(-)

diff --git a/forward.c b/forward.c
index dfef4ef..96c6b9a 100644
--- a/forward.c
+++ b/forward.c
@@ -1005,7 +1005,7 @@ process_incoming_tun (struct context *c)
 void
 process_ipv4_header (struct context *c, unsigned int flags, struct buffer *buf)
 {
-  if (!c->options.mssfix)
+  if (!c->options.ce.mssfix)
 flags &= ~PIPV4_MSSFIX;
 #if PASSTOS_CAPABILITY
   if (!c->options.passtos)
diff --git a/init.c b/init.c
index 51b0d64..8f42120 100644
--- a/init.c
+++ b/init.c
@@ -1786,10 +1786,10 @@ do_deferred_options (struct context *c, const unsigned 
int found)
 #ifdef ENABLE_OCC
   if (found & OPT_P_EXPLICIT_NOTIFY)
 {
-  if (!proto_is_udp(c->options.ce.proto) && 
c->options.explicit_exit_notification)
+  if (!proto_is_udp(c->options.ce.proto) && 
c->options.ce.explicit_exit_notification)
{
  msg (D_PUSH, "OPTIONS IMPORT: --explicit-exit-notify can only be used 
with --proto udp");
- c->options.explicit_exit_notification = 0;
+ c->options.ce.explicit_exit_notification = 0;
}
   else
msg (D_PUSH, "OPTIONS IMPORT: explicit notify parm(s) modified");
@@ -1962,10 +1962,10 @@ frame_finalize_options (struct context *c, const struct 
options *o)
 }

   frame_finalize (&c->c2.frame,
- o->link_mtu_defined,
- o->link_mtu,
- o->tun_mtu_defined,
- o->tun_mtu);
+ o->ce.link_mtu_defined,
+ o->ce.link_mtu,
+ o->ce.tun_mtu_defined,
+ o->ce.tun_mtu);
 }

 /*
@@ -2411,8 +2411,8 @@ do_init_frame (struct context *c)
   /*
* Adjust frame size based on the --tun-mtu-extra parameter.
*/
-  if (c->options.tun_mtu_extra_defined)
-tun_adjust_frame_parameters (&c->c2.frame, c->options.tun_mtu_extra);
+  if (c->options.ce.tun_mtu_extra_defined)
+tun_adjust_frame_parameters (&c->c2.frame, c->options.ce.tun_mtu_extra);

   /*
* Adjust frame size based on link socket parameters.
@@ -2441,13 +2441,13 @@ do_init_frame (struct context *c)
   /*
* MTU advisories
*/
-  if (c->options.fragment && c->options.mtu_test)
+  if (c->options.ce.fragment && c->options.mtu_test)
 msg (M_WARN,
 "WARNING: using --fragment and --mtu-test together may produce an 
inaccurate MTU test result");
 #endif

 #ifdef ENABLE_FRAGMENT
-  if ((c->options.mssfix || c->options.fragment)
+  if ((c->options.ce.mssfix || c->options.ce.fragment)
   && TUN_MTU_SIZE (&c->c2.frame_fragment) != ETHERNET_MTU)
 msg (M_WARN,
 "WARNING: normally if you use --mssfix and/or --fragment, you should 
also set --tun-mtu %d (currently it is %d)",
@@ -2619,9 +2619,9 @@ do_init_buffers (struct context *c)
 static void
 do_init_fragment (struct context *c)
 {
-  ASSERT (c->options.fragment);
+  ASSERT (c->options.ce.fragment);
   frame_set_mtu_dynamic (&c->c2.frame_fragment,
-c->options.fragment, SET_MTU_UPPER_BOUND);
+c->options.ce.fragment, SET_MTU_UPPER_BOUND);
   fragment_frame_init (c->c2.fragment, &c->c2.frame_fragment);
 }
 #endif
@@ -2632,10 +2632,10 @@ do_init_fragment (struct context *c)
 static void
 do_init_mssfix (struct context *c)
 {
-  if (c->options.mssfix)
+  if (c->options.ce.mssfix)
 {
   frame_set_mtu_dynamic (&c->c2.frame,
-c->options.mssfix, SET_MTU_UPPER_BOUND);
+c->options.ce.mssfix, SET_MTU_UPPER_BOUND);
 }
 }

@@ -2691,7 +2691,7 @@ do_init_socket_1 (struct context *c, const int mode)
   c->options.ce.connect_retry_seconds,
   c->options.ce.connect_timeout,
   c->options.ce.connect_retry_max,
-  c->options.mtu_discover_type,
+  c->options.ce.mtu_discover_type,
   c->options.rcvbuf,
   c->options.sndbuf,
   c->options.mark,
@@ -3406,7 +3408,7 @@ init_instance (struct context *c, const struct env_set 
*env, const unsigned int

 #ifdef ENABLE_FRAGMENT
   /* initialize internal fragmentation object */
-  if (options->fragment && (c->mode == CM_P2P || child))
+  if (options->ce.fragment && (c->mode == CM_P2P || child))
 c->c2.fragment = fragment_init (&c->c2.frame);
 #endif

@@ -3442,7 +3444,7 @@ init_instance (struct context *c, const st