Re: OpenVPN



I've dug into the code a bit and come up with the attached patch, but it
still doesn't seem to be working.  Watching the system bus with
dbus-monitor shows the following DBus message being sent:

signal sender=:1.54 -> dest=(null destination) interface=org.freedesktop.NetworkManager.openvpn; member=IP4Config
 uint32 4020547391
string "tun0"
uint32 100733100
uint32 83955884
uint32 16777215
[uint32 33558700
][uint32 0
]uint32 0
string ""
string ""

This shows that the additional parameters I added to the DBus message
are there.  This is my first attempt at hacking DBus/NetworkManager so
I'm sure I've done something completely boneheaded here...

On Wed, 2006-04-26 at 08:42 -0500, Jeffrey C. Ollie wrote:
> I am trying to get Network Manager to open up a OpenVPN connection from
> my Fedora development laptop to my FC4 gateway at home.  The OpenVPN
> connection starts up and is working (as evidenced by the correct routes
> being installed in the kernel and traffic flowing properly).  However,
> Network Manager doesn't seem to think that the connection was started
> properly.  My laptop is running NetworkManager 0.6.2 (Fedora development
> rpm) and a CVS checkout of the OpenVPN plugin from yesterday.  Here's
> the log from my laptop:
> 
> Apr 26 08:17:24 lt16585 NetworkManager: <information>   Will activate VPN connection 'Home', service 'org.freedesktop.NetworkManager.openvpn', user_name 'jcollie', vpn_data 'connection-type / x509 / dev / tun / remote / gw1.ocjtech.us / proto / udp / ca / /home/jcollie/vpn/ca.crt / cert / /home/jcollie/vpn/lt16585.campus.dmacc.edu.crt / key / /home/jcollie/vpn/lt16585.campus.dmacc.edu.key / comp-lzo / no / shared-key /  / local-ip /  / remote-ip /  / username / ', route '172.16.0.0/24 / 172.16.1.0/24'.
> Apr 26 08:17:24 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 1 of 4 (Connection Prepare) scheduled...
> Apr 26 08:17:24 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 1 of 4 (Connection Prepare) ran VPN service daemon org.freedesktop.NetworkManager.openvpn (PID 9934)
> Apr 26 08:17:24 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 1 of 4 (Connection Prepare) complete.
> Apr 26 08:17:24 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 2 of 4 (Connection Prepare Wait) scheduled...
> Apr 26 08:17:24 lt16585 NetworkManager: <information>   VPN service 'org.freedesktop.NetworkManager.openvpn' signaled state change 1 -> 6.
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 2 of 4 (Connection Prepare Wait) waiting...
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 2 of 4 (Connection Prepare Wait) complete.
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 3 of 4 (Connect) scheduled...
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 3 of 4 (Connect) sending connect request.
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 3 of 4 (Connect) request sent, waiting for reply...
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN service 'org.freedesktop.NetworkManager.openvpn' signaled state change 6 -> 3.
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 3 of 4 (Connect) reply received.
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 4 of 4 (IP Config Get) timeout scheduled...
> Apr 26 08:17:25 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 3 of 4 (Connect) complete, waiting for IP configuration...
> Apr 26 08:17:25 lt16585 nm-openvpn[9936]: OpenVPN 2.1_beta14 i386-redhat-linux-gnu [SSL] [LZO1] [EPOLL] built on Apr 14 2006
> Apr 26 08:17:25 lt16585 nm-openvpn[9936]: UDPv4 link local: [undef]
> Apr 26 08:17:25 lt16585 nm-openvpn[9936]: UDPv4 link remote: 63.175.164.239:1194
> Apr 26 08:17:27 lt16585 nm-openvpn[9936]: [gw1.ocjtech.us] Peer Connection Initiated with 63.175.164.239:1194
> Apr 26 08:17:28 lt16585 nm-openvpn[9936]: TUN/TAP device tun0 opened
> Apr 26 08:17:28 lt16585 nm-openvpn[9936]: /sbin/ip link set dev tun0 up mtu 1500
> Apr 26 08:17:28 lt16585 nm-openvpn[9936]: /sbin/ip addr add dev tun0 local 172.16.1.6 peer 172.16.1.5
> Apr 26 08:17:28 lt16585 nm-openvpn[9936]: /usr/bin/nm-openvpn-service-openvpn-helper tun0 1500 1541 172.16.1.6 172.16.1.5 init
> Apr 26 08:17:28 lt16585 NetworkManager: <information>   VPN Activation (Home) Stage 4 of 4 (IP Config Get) reply received.
> Apr 26 08:17:28 lt16585 NetworkManager: <WARNING>        get_dbus_string_helper (): Error: couldn't get DNS Domain from VPN IP Config message.
> Apr 26 08:17:28 lt16585 NetworkManager: <WARNING>        nm_vpn_service_stage4_ip_config_get (): (VPN Service org.freedesktop.NetworkManager.openvpn): did not receive valid IP config information.
> Apr 26 08:17:28 lt16585 NetworkManager: <information>   VPN Activation (Home) failed.
> Apr 26 08:17:28 lt16585 NetworkManager: <information>   VPN service 'org.freedesktop.NetworkManager.openvpn' signaled state change 3 -> 4.
> Apr 26 08:17:28 lt16585 NetworkManager: <information>   VPN service 'org.freedesktop.NetworkManager.openvpn' signaled state change 4 -> 5.
> Apr 26 08:17:28 lt16585 NetworkManager: <information>   VPN service 'org.freedesktop.NetworkManager.openvpn' signaled state change 5 -> 6.
> Apr 26 08:17:28 lt16585 nm-openvpn[9936]: Initialization Sequence Completed
> 
> _______________________________________________
> NetworkManager-list mailing list
> NetworkManager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list
Index: src/nm-openvpn-service-openvpn-helper.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/vpn-daemons/openvpn/src/nm-openvpn-service-openvpn-helper.c,v
retrieving revision 1.7
diff -u -r1.7 nm-openvpn-service-openvpn-helper.c
--- src/nm-openvpn-service-openvpn-helper.c	30 Mar 2006 17:21:18 -0000	1.7
+++ src/nm-openvpn-service-openvpn-helper.c	26 Apr 2006 20:39:46 -0000
@@ -140,7 +140,10 @@
 		  const char *str_ip4_ptpaddr,
 		  const char *str_ip4_netmask,
 		  const GPtrArray *gpa_ip4_dns,
-		  const GPtrArray *gpa_ip4_nbns
+		  const GPtrArray *gpa_ip4_nbns,
+		  const guint32 uint_mss,
+		  const char *str_dns_domain,
+		  const char *str_vpn_login_banner
 		  )
 {
   DBusMessage *	message;
@@ -195,7 +198,11 @@
 			    DBUS_TYPE_UINT32, &uint_ip4_netmask,
 			    DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &uint_ip4_dns, uint_ip4_dns_len,
 			    DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &uint_ip4_nbns, uint_ip4_nbns_len,
+			    DBUS_TYPE_UINT32, &uint_mss,
+			    DBUS_TYPE_STRING, &str_dns_domain,
+			    DBUS_TYPE_STRING, &str_vpn_login_banner,
 			    DBUS_TYPE_INVALID);
+  nm_warning ("sending dbus message");
   if (dbus_connection_send (con, message, NULL))
     success = TRUE;
   else
@@ -248,7 +255,10 @@
   char            *ip4_netmask = NULL;
   GPtrArray       *ip4_dns = NULL;
   GPtrArray       *ip4_nbns = NULL;
-  
+  guint32          mss = 0;
+  char            *dns_domain = NULL;
+  char            *vpn_login_banner = NULL;
+
   char           **split = NULL;
   char           **item;
 
@@ -300,13 +310,16 @@
 	if ( size != 3 ) continue;
 	
 	if (strcmp( split[0], "dhcp-option") == 0) {
-	  // Interesting, now check if DNS or NBNS/WINS
+	  // Interesting, now check if DNS, NBNS/WINS, or DOMAIN
 	  if (strcmp( split[1], "DNS") == 0) {
 	    // DNS, push it!
 	    g_ptr_array_add( ip4_dns, (gpointer) split[2] );
 	  } else if (strcmp( split[1], "WINS") == 0) {
 	    // WINS, push it!
-	    g_ptr_array_add( ip4_nbns, (gpointer) split[2] );		  
+	    g_ptr_array_add( ip4_nbns, (gpointer) split[2] ); 
+	  } else if (strcmp( split[1], "DOMAIN") == 0) {
+	    // DOMAIN, push it!
+	    dns_domain = g_strdup (split[2]);
 	  }
 	}
       }
@@ -344,9 +357,20 @@
     ip4_netmask = g_strdup ("");
   }
 
+  if (!dns_domain) {
+    dns_domain = g_strdup ("");
+  }
+
+  if (!vpn_login_banner) {
+    vpn_login_banner = g_strdup ("");
+  }
+
   if (!send_config_info (con, vpn_gateway, tundev,
 			 ip4_address, ip4_ptp, ip4_netmask,
-			 ip4_dns, ip4_nbns)) {
+			 ip4_dns, ip4_nbns,
+			 mss,
+			 dns_domain,
+			 vpn_login_banner)) {
     exit_code = 1;
   }
   

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]