[Patch] openvpn with TCP

2006-10-02 Thread Tambet Ingo
Hey,

Here's a patch to make openvpn work with TCP port. NM uses --proto tcp
which, according to the manual page (and a bug #190940 in bnc), isn't
correct.

Tambet
Index: openvpn/properties/nm-openvpn.c
===
RCS file: /cvs/gnome/NetworkManager/vpn-daemons/openvpn/properties/nm-openvpn.c,v
retrieving revision 1.4.2.3
diff -u -r1.4.2.3 nm-openvpn.c
--- openvpn/properties/nm-openvpn.c	27 Sep 2006 15:10:23 -	1.4.2.3
+++ openvpn/properties/nm-openvpn.c	2 Oct 2006 12:10:59 -
@@ -225,7 +225,7 @@
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl-w_use_tap), TRUE);
   should_expand = TRUE;
 } else if ( (strcmp (key,   proto) == 0) 
-		(strcmp (value, tcp) == 0) ) {
+		(strcmp (value, tcp-client) == 0) ) {
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl-w_use_tcp), TRUE);
   should_expand = TRUE;
 } else if (strcmp (key, cipher) == 0) {
@@ -328,7 +328,7 @@
   data = g_slist_append (data, g_strdup (remote));
   data = g_slist_append (data, g_strdup (remote));
   data = g_slist_append (data, g_strdup (proto));
-  data = g_slist_append (data, use_tcp ? g_strdup (tcp) : g_strdup(udp));
+  data = g_slist_append (data, use_tcp ? g_strdup (tcp-client) : g_strdup(udp));
   data = g_slist_append (data, g_strdup (ca));
   data = g_slist_append (data, g_strdup (ca));
   data = g_slist_append (data, g_strdup (cert));
@@ -980,7 +980,7 @@
 	should_expand = TRUE;
   }
 
-  if ( strcmp (proto, tcp) == 0 ) {
+  if ( strcmp (proto, tcp-client) == 0 ) {
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl-w_use_tcp), TRUE);
 	should_expand = TRUE;
   }
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [Patch] openvpn with TCP

2006-10-02 Thread Tambet Ingo
On Mon, 2006-10-02 at 10:06 -0400, Dan Williams wrote:
 Patch looks fine; but did OpenVPN previously use 'tcp'?  Or has it
 always used 'tcp-client'?  It seems odd that there is a 'udp' option,
 but the TCP option is called 'tcp-client'.  I'd expect it to be either
 'tcp'  'udp', or 'tcp-client'  'udp-client'.  I don't want to break
 stuff on an upgrade unless we know exactly what we're breaking.

From the information I could gather (mostly from openvpn ChangeLog), it
looks like 'tcp' is provided as a shortcut, but only works if the
'-server' or '-client' part can be guessed (from --mode I think). The
first time '--proto tcp-client' is mentioned in the ChangeLog is from
2004.01.14 -- Version 1.6-beta1.

Tambet

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list