Re: Debian backend fixes and other issues

2006-02-09 Thread Antony J Mee

Hi Tom,

I'm not running Debian (rather Gentoo, it's illegitimate child) but I 
have the same issue and

adding "#define HEADERS_KERNEL" seems to fix this.

I'd love to say I understand why this works, or tell you where I got 
this information but
sadly I know neither! :-)  Perhaps it was that Gentopia guys that found 
this.


More specifically:

Index: nm-device-802-3-ethernet.c
===
RCS file: /cvs/gnome/NetworkManager/src/nm-device-802-3-ethernet.c,v
retrieving revision 1.12
diff -u -r1.12 nm-device-802-3-ethernet.c
--- nm-device-802-3-ethernet.c  26 Jan 2006 21:55:11 -  1.12
+++ nm-device-802-3-ethernet.c  9 Feb 2006 17:33:26 -
@@ -18,6 +18,7 @@
 *
 * (C) Copyright 2005 Red Hat, Inc.
 */
+#define HEADERS_KERNEL

#include 
#include 


Regards,

tOnY

Tom Parker wrote:

After a long time of not having any time to look at NetworkManager, I 
decided to have another look. Tried compiling from the current CVS 
HEAD, and noted that the debian backend required a number of 
alterations (mainly because of unused variables, and also to remove 
the nm_system_device_setup_static_ip4_config item from 
src/NetworkManagerSystem.h as it isn't used anywhere anymore). Patch 
to fix those is attached.


However, later on while trying to compile 
src/nm-device-802-3-ethernet.c I got the following. Any ideas anyone?



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


Re: [PATCH] For NetworkManager to send the routes to VPN Daemons

2006-02-09 Thread Dan Williams
On Thu, 2006-02-09 at 17:32 +0530, Vinay wrote:
> Hi,
> 
> In case of Standard Gateways, IPSec VPNs push routes through setkey
> mechanisms. NetworkManager does not pass routes to vpn daemons.
> 
> Attached patch makes NetworkManager to send routes to vpn daemons.

Looks good in principle, but is the problem here that the VPN daemon
wants sets the routes, not NetworkManager?  This patch appears to allow
the VPN daemon to get a list of user-configured routes.  What does the
VPN daemon do with those routes?  How does is it affected when NM sets
the routes explicitly later on?

Also, one quick error in the patch...  you likely need to g_free
(routes_string); in the bit for nm-dbus-vpn.c, otherwise I think it just
leaks the string.

Dan


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


[PATCH] For NetworkManager to send the routes to VPN Daemons

2006-02-09 Thread Vinay
Hi,

In case of Standard Gateways, IPSec VPNs push routes through setkey
mechanisms. NetworkManager does not pass routes to vpn daemons.

Attached patch makes NetworkManager to send routes to vpn daemons.

Appreciate any comments on this.

Thanks and Regards,
Vinay

 
Index: ChangeLog
===
RCS file: /cvs/gnome/NetworkManager/ChangeLog,v
retrieving revision 1.815
diff -u -r1.815 ChangeLog
--- ChangeLog	7 Feb 2006 15:39:50 -	1.815
+++ ChangeLog	9 Feb 2006 10:51:10 -
@@ -1,3 +1,23 @@
+2006-02-09 Vinay A R <[EMAIL PROTECTED]>
+
+	* src/vpn-manager/nm-vpn-act-request.h 
+	* src/vpn-manager/nm-vpn-act-request.c : Added 'routes' and 'routes_count' to struct NMVPNActRequest 
+		 since IPSec VPNs require them for std gateway.
+		  (nm_vpn_act_request_new) : takes additional 2 arguments - 'routes' and 'routes_count'
+	   : New Function - 'nm_vpn_act_request_get_routes' , 
+		 gets routes from NMVPNActRequest object, returns char ** routes.
+
+	* src/vpn-manager/nm-vpn-manager.h :
+	* src/vpn-manager/nm-vpn-manager.c : 'nm_vpn_manager_activate_vpn_connection' takes additional 
+	 2 arguments - 'routes' and 'routes_count' since 'nm_vpn_act_request_new' requires them.
+	
+	* src/vpn-manager/nm-dbus-vpn.c : 
+		(nm_dbus_vpn_activate_connection) : gets 'routes' from 'nm_dbus_vpn_get_routes' 
+		to pass to 'nm_vpn_manager_activate_vpn_connection'
+	
+	* src/vpn-manager/nm-vpn-service.c : gets routes from 'nm_vpn_act_request_get_routes' and
+	 and passes to vpn.
+	
 2006-02-07  Robert Love  <[EMAIL PROTECTED]>
 
 	Patch by Stefan Seyfried <[EMAIL PROTECTED]>:
Index: src/vpn-manager/nm-dbus-vpn.c
===
RCS file: /cvs/gnome/NetworkManager/src/vpn-manager/nm-dbus-vpn.c,v
retrieving revision 1.14
diff -u -r1.14 nm-dbus-vpn.c
--- src/vpn-manager/nm-dbus-vpn.c	31 Dec 2005 08:21:24 -	1.14
+++ src/vpn-manager/nm-dbus-vpn.c	9 Feb 2006 10:51:10 -
@@ -701,14 +701,17 @@
 		{
 			int	item_count = -1;
 			char **items;
-
+			int routes_count = -1;
+			char **routes;
+			routes = nm_dbus_vpn_get_routes (connection, vpn, &routes_count);
 			if ((items = nm_dbus_vpn_get_vpn_data (connection, vpn, &item_count)))
 			{
 char *	joined_string = g_strjoinv (" / ", items);
-
-nm_info ("Will activate VPN connection '%s', service '%s', user_name '%s', vpn_data '%s'.",
-	name, nm_vpn_connection_get_service_name (vpn), nm_vpn_connection_get_user_name (vpn), joined_string);
-nm_vpn_manager_activate_vpn_connection (data->data->vpn_manager, vpn, passwords, num_passwords, items, item_count);
+char *  routes_string = g_strjoinv (" / ", routes);
+nm_info ("Will activate VPN connection '%s', service '%s', user_name '%s', vpn_data '%s', route '%s'.",
+name, nm_vpn_connection_get_service_name (vpn), nm_vpn_connection_get_user_name (vpn), joined_string, routes_string);
+nm_vpn_manager_activate_vpn_connection (data->data->vpn_manager, vpn, passwords, num_passwords, items, item_count, 
+	routes, routes_count);
 
 g_free (joined_string);
 g_strfreev (items);
Index: src/vpn-manager/nm-vpn-act-request.c
===
RCS file: /cvs/gnome/NetworkManager/src/vpn-manager/nm-vpn-act-request.c,v
retrieving revision 1.3
diff -u -r1.3 nm-vpn-act-request.c
--- src/vpn-manager/nm-vpn-act-request.c	31 Dec 2005 08:21:24 -	1.3
+++ src/vpn-manager/nm-vpn-act-request.c	9 Feb 2006 10:51:10 -
@@ -40,6 +40,8 @@
 	intpassword_count;
 	char **			data_items;
 	intdata_count;
+	char **			routes;
+	int 			routes_count;
 
 	guint			daemon_wait_count;
 	guint			callback_id;
@@ -48,7 +50,8 @@
 
 
 NMVPNActRequest *nm_vpn_act_request_new (NMVPNManager *manager, NMVPNService *service, NMVPNConnection *vpn,
-NMDevice *parent_dev, char **password_items, int password_count, char **data_items, int data_count)
+	NMDevice *parent_dev, char **password_items, int password_count, char **data_items, int data_count,
+	char **routes, int routes_count)
 {
 	NMVPNActRequest	*req;
 
@@ -75,6 +78,8 @@
 	req->password_count = password_count;
 	req->data_items = g_strdupv (data_items);
 	req->data_count = data_count;
+	req->routes = g_strdupv (routes);
+	req->routes_count = routes_count;
 
 	return req;
 }
@@ -192,6 +197,12 @@
 
 	*count = req->data_count;
 	return (const char **) (req->data_items);
+}
+
+const char ** nm_vpn_act_request_get_routes (NMVPNActRequest *req, guint *count)
+{
+	*count = req->routes_count;
+	return (const char **) (req->routes);
 }
 
 void nm_vpn_act_request_cancel (NMVPNActRequest *req)
Index: src/vpn-manager/nm-vpn-act-request.h
===
RCS file: /cvs/gnome/NetworkManager/src/vpn-manager/nm-vpn-act-request.h,v
retrieving revision 1.1
diff -u -r1.1 nm-vpn-act-request.h
--- src/vpn-manager/nm-vpn-act-request.

Re: Detecting wired network on resume with 8139

2006-02-09 Thread James Ettle
On Thu, 2006-02-09 at 12:38 +0100, Nikolaus Filus wrote:
> Hi,
> 
> I have exactly the same problem and wanted to collect some information for 
> a bug report. Now here they are

Thanks Nikolaus. Should we now be reporting bugs in 8139too to our
respective distro maintainers (Fedora for me)?

James

-- 
James Ettle[EMAIL PROTECTED]
Southampton High Energy Physics
School of Physics and Astronomy
University of Southampton, SO17 1BJ
PGP key: http://www.hep.phys.soton.ac.uk/~jhe/pgp-public/jhe-shep.asc
---


signature.asc
Description: This is a digitally signed message part
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Detecting wired network on resume with 8139

2006-02-09 Thread Nikolaus Filus
Hi,

I have exactly the same problem and wanted to collect some information for 
a bug report. Now here they are


On Wednesday 08 February 2006 17:27, Dan Williams wrote:
> On Wed, 2006-02-08 at 16:27 +, James Ettle wrote:
> > Something I've noticed is that if I'm on a wireless network
> > (ipw2200), suspend, move outside the range of that network, plug in
> > to wired, and then resume, NM doesn't seem to pick up on the
> > connection. This is with the 8139too driver on an RTL-8100B/8139D.
>
> Immediately after resuming, can you:
>
> cat /sys/class/net/eth0/carrier
>
> (replace eth0 with the interface name of your 8139).  This tells us
> what netlink thinks the current carrier state of the card is (ie,
> whether it thinks there's a cable or not).

eth1 is my wired, using 8139too from 2.6.14.3:
after resume and nm wake up 

mobile ~ # ifplugstatus -v
eth1:
SIOCETHTOOL: link beat detected
SIOCGMIIPHY: link beat detected
Wireless failed.
IFF_RUNNING: unplugged
SIOCDEVPRIVATE failed (Operation not supported)

mobile ~ # cat /sys/class/net/eth0/carrier
1
mobile ~ # cat /sys/class/net/eth1/carrier
cat: /sys/class/net/eth1/carrier: Invalid argument
--
then, after restarting nm:

mobile ~ # ifplugstatus -v eth1
eth1:
SIOCETHTOOL: link beat detected
SIOCGMIIPHY: link beat detected
Wireless failed.
IFF_RUNNING: link beat detected
SIOCDEVPRIVATE failed (Operation not supported)

mobile ~ # cat /sys/class/net/eth1/carrier
1



Hope that helps.


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


Debian backend fixes and other issues

2006-02-09 Thread Tom Parker
After a long time of not having any time to look at NetworkManager, I decided to 
have another look. Tried compiling from the current CVS HEAD, and noted that the 
debian backend required a number of alterations (mainly because of unused 
variables, and also to remove the nm_system_device_setup_static_ip4_config item 
from src/NetworkManagerSystem.h as it isn't used anywhere anymore). Patch to fix 
those is attached.


However, later on while trying to compile src/nm-device-802-3-ethernet.c I got 
the following. Any ideas anyone?


if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -I../src/named-manager 
-I../src/vpn-manager -I../src/dhcp-manager -I../utils -I../libnm-util 
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -DDBUS_VERSION_MAJOR=0 -DDBUS_VERSION_MINOR=60 
-DDBUS_VERSION_MICRO=0 -pthread -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal 
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include 
-DWPA_SUPPLICANT_BIN=\"/usr/sbin/wpa_supplicant\" -DDBUS_API_SUBJECT_TO_CHANGE 
-DG_DISABLE_DEPRECATED -DBINDIR=\"/usr/local/bin\" 
-DDATADIR=\"/usr/local/share\" -DSYSCONFDIR=\"/usr/local/etc\" 
-DLOCALSTATEDIR=\"/usr/local/var\" 
-DNM_RUN_DIR=\"/usr/local/var/run/NetworkManager\" -DARP_DEBUG   -Wall -Werror 
-std=gnu89 -g -O2 -Wshadow -Wmissing-declarations -Wmissing-prototypes 
-Wdeclaration-after-statement -Wfloat-equal -Wno-unused-parameter 
-Wno-sign-compare -MT NetworkManager-nm-device-802-3-ethernet.o -MD -MP -MF 
".deps/NetworkManager-nm-device-802-3-ethernet.Tpo" -c -o 
NetworkManager-nm-device-802-3-ethernet.o `test -f 'nm-device-802-3-ethernet.c' 
|| echo './'`nm-device-802-3-ethernet.c; \
then mv -f ".deps/NetworkManager-nm-device-802-3-ethernet.Tpo" 
".deps/NetworkManager-nm-device-802-3-ethernet.Po"; else rm -f 
".deps/NetworkManager-nm-device-802-3-ethernet.Tpo"; exit 1; fi

In file included from /usr/include/linux/mii.h:12,
 from nm-device-802-3-ethernet.c:364:
/usr/include/linux/if.h:95: error: redefinition of 'struct ifmap'
/usr/include/linux/if.h:131: error: redefinition of 'struct ifreq'
/usr/include/linux/if.h:181: error: redefinition of 'struct ifconf'

The /usr/include/linux/* files on my system are provided by the 
linux-kernel-headers package, and I've currently got the 2.6.13+0rc3-2 version 
of that installed.


Tom Parker
--
[EMAIL PROTECTED] - http://tevp.net
Illegitimus non carborundum
Index: src/NetworkManagerSystem.h
===
RCS file: /cvs/gnome/NetworkManager/src/NetworkManagerSystem.h,v
retrieving revision 1.15
diff -u -r1.15 NetworkManagerSystem.h
--- src/NetworkManagerSystem.h  23 Jan 2006 21:02:37 -  1.15
+++ src/NetworkManagerSystem.h  9 Feb 2006 10:48:43 -
@@ -46,7 +46,6 @@
 void   nm_system_device_flush_addresses
(NMDevice *dev);
 void   nm_system_device_flush_addresses_with_iface (const 
char *iface);
 
-gboolean   nm_system_device_setup_static_ip4_config
(NMDevice *dev);
 void   nm_system_enable_loopback   
(void);
 void   nm_system_flush_loopback_routes (void);
 void   nm_system_delete_default_route  (void);
Index: src/backends/NetworkManagerDebian.c
===
RCS file: /cvs/gnome/NetworkManager/src/backends/NetworkManagerDebian.c,v
retrieving revision 1.38
diff -u -r1.38 NetworkManagerDebian.c
--- src/backends/NetworkManagerDebian.c 23 Jan 2006 21:02:38 -  1.38
+++ src/backends/NetworkManagerDebian.c 9 Feb 2006 10:48:43 -
@@ -111,8 +111,6 @@
  */
 void nm_system_device_flush_routes (NMDevice *dev)
 {
-   char*buf;
-
g_return_if_fail (dev != NULL);
 
/* Not really applicable for test devices */
@@ -177,117 +175,6 @@
 }
 
 /*
- * nm_system_device_setup_static_ip4_config
- *
- * Set up the device with a particular IPv4 address/netmask/gateway.
- *
- * Returns:TRUEon success
- * FALSE on error
- *
- */
-#if 0
-gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev)
-{
-#define IPBITS (sizeof (guint32) * 8)
-struct in_addr  temp_addr;
-struct in_addr  temp_addr2;
-char*s_tmp;
-char*s_tmp2;
-int i;
-guint32 addr;
-guint32 netmask;
-guint32 prefix = IPBITS;/* initialize with # bits in ipv4 
address */
-guint32 broadcast;
-char*buf;
-int err;
-const char*iface;
-
-g_return_val_if_fail (dev != NULL, FALSE);
-g_return_val_if_fail (!nm_device_config_get_use_dhcp (dev), FALSE);
-
-addr = nm_device_config_get_ip4_address (dev);
-