about summary refs log tree commit diff
path: root/debian/patches
diff options
context:
space:
mode:
authorMichael Biebl <biebl@teco.edu>2006-04-05 17:29:39 +0000
committerMichael Biebl <biebl@teco.edu>2006-04-05 17:29:39 +0000
commitf7e18eab4786f1e1be4b25c7231074d66d3e430a (patch)
tree663a83155af868a1df71c9ee71890c8bb39f3fcc /debian/patches
parentab79d32b92a7c7c479af685ce345956344a4b5e4 (diff)
Integration work. Scripts in /etc/network/if-*.d/ are now called properly by NetworkManagerDispatcher. Thanks to the Ubuntu guys for this works. It's mostly copied from their package.
git-svn-id: svn+ssh://svn.debian.org/svn/pkg-utopia/packages/unstable/networkmanager@790 ceb527fc-18e6-0310-9fe2-813c157c29e7
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/06-dispatch_more_events.patch104
1 files changed, 104 insertions, 0 deletions
diff --git a/debian/patches/06-dispatch_more_events.patch b/debian/patches/06-dispatch_more_events.patch
new file mode 100644
index 00000000..e8b30810
--- /dev/null
+++ b/debian/patches/06-dispatch_more_events.patch
@@ -0,0 +1,104 @@
+diff -ruNp network-manager-0.6.2~/dispatcher-daemon/NetworkManagerDispatcher.c network-manager-0.6.2/dispatcher-daemon/NetworkManagerDispatcher.c
+--- network-manager-0.6.2~/dispatcher-daemon/NetworkManagerDispatcher.c	2006-03-13 16:51:57.000000000 +0000
++++ network-manager-0.6.2/dispatcher-daemon/NetworkManagerDispatcher.c	2006-04-03 18:14:06.000000000 +0100
+@@ -44,6 +44,8 @@ enum NMDAction
+ 	NMD_DEVICE_DONT_KNOW,
+ 	NMD_DEVICE_NOW_INACTIVE,
+ 	NMD_DEVICE_NOW_ACTIVE,
++	NMD_DEVICE_GOING_INACTIVE,
++	NMD_DEVICE_GOING_ACTIVE,
+ };
+ typedef enum NMDAction	NMDAction;
+ 
+@@ -95,6 +97,10 @@ static void nmd_execute_scripts (NMDActi
+ 	if (action == NMD_DEVICE_NOW_ACTIVE)
+ 		char_act = "up";
+ 	else if (action == NMD_DEVICE_NOW_INACTIVE)
++		char_act = "post-down";
++	else if (action == NMD_DEVICE_GOING_ACTIVE)
++		char_act = "pre-up";
++	else if (action == NMD_DEVICE_GOING_INACTIVE)
+ 		char_act = "down";
+ 	else
+ 		return;
+@@ -217,9 +223,13 @@ static DBusHandlerResult nmd_dbus_filter
+ 	}
+ 
+ 	if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive"))
+-		action = NMD_DEVICE_NOW_INACTIVE;
++		action = NMD_DEVICE_GOING_INACTIVE;
+ 	else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive"))
+ 		action = NMD_DEVICE_NOW_ACTIVE;
++	else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating"))
++		action = NMD_DEVICE_GOING_ACTIVE;
++	else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceDeactivated"))
++		action = NMD_DEVICE_NOW_INACTIVE;
+ 
+ 	if (action != NMD_DEVICE_DONT_KNOW)
+ 	{
+@@ -234,8 +244,10 @@ static DBusHandlerResult nmd_dbus_filter
+ 			if (dev_object_path && dev_iface_name)
+ 			{
+ 				nm_info ("Device %s (%s) is now %s.", dev_object_path, dev_iface_name,
+-						(action == NMD_DEVICE_NOW_INACTIVE ? "down" :
+-						(action == NMD_DEVICE_NOW_ACTIVE ? "up" : "error")));
++						(action == NMD_DEVICE_NOW_INACTIVE ? "going down" :
++						(action == NMD_DEVICE_NOW_ACTIVE ? "up" :
++						(action == NMD_DEVICE_GOING_INACTIVE ? "going down" :
++						(action == NMD_DEVICE_GOING_ACTIVE ? "going up" : "error")))));
+ 
+ 				nmd_execute_scripts (action, dev_iface_name);
+ 			}
+diff -ruNp network-manager-0.6.2~/man/NetworkManagerDispatcher.1.in network-manager-0.6.2/man/NetworkManagerDispatcher.1.in
+--- network-manager-0.6.2~/man/NetworkManagerDispatcher.1.in	2006-04-03 18:10:32.000000000 +0100
++++ network-manager-0.6.2/man/NetworkManagerDispatcher.1.in	2006-04-03 18:14:06.000000000 +0100
+@@ -13,10 +13,14 @@ The \fINetworkManagerDispatcher\fP daemo
+ directory in response to interfaces coming up and down.  The scripts are run
+ alphabetically.  The first parameter is the network interface name.  The second
+ parameter is
++.I pre\-up
++before bringing the interface up,
+ .I up
+-if the interface is now up and
++after bringing the interface up,
+ .I down
+-if the interface is now down.
++before taking the interface down and
++.I post\-down
++after taking the interface down.
+ .SH OPTIONS
+ The following options are supported:
+ .TP
+diff -ruNp network-manager-0.6.2~/src/NetworkManagerDbus.c network-manager-0.6.2/src/NetworkManagerDbus.c
+--- network-manager-0.6.2~/src/NetworkManagerDbus.c	2006-02-24 18:59:03.000000000 +0000
++++ network-manager-0.6.2/src/NetworkManagerDbus.c	2006-04-03 18:14:06.000000000 +0100
+@@ -193,6 +193,7 @@ static DeviceStatusSignals dev_status_si
+ 	{ DEVICE_NOW_ACTIVE,		"DeviceNowActive"		},
+ 	{ DEVICE_ACTIVATING,		"DeviceActivating"		},
+ 	{ DEVICE_ACTIVATION_FAILED,	"DeviceActivationFailed"	},
++	{ DEVICE_DEACTIVATED,		"DeviceDeactivated"		},
+ 	{ DEVICE_ADDED,			"DeviceAdded"			},
+ 	{ DEVICE_REMOVED,			"DeviceRemoved"		},
+ 	{ DEVICE_CARRIER_ON,		"DeviceCarrierOn"		},
+diff -ruNp network-manager-0.6.2~/src/NetworkManagerDbus.h network-manager-0.6.2/src/NetworkManagerDbus.h
+--- network-manager-0.6.2~/src/NetworkManagerDbus.h	2005-12-31 08:21:22.000000000 +0000
++++ network-manager-0.6.2/src/NetworkManagerDbus.h	2006-04-03 18:14:06.000000000 +0100
+@@ -40,6 +40,7 @@ typedef enum
+ 	DEVICE_ACTIVATING,
+ 	DEVICE_ACTIVATION_FAILED,
+ 	DEVICE_ACTIVATION_CANCELED,
++	DEVICE_DEACTIVATED,
+ 	DEVICE_ADDED,
+ 	DEVICE_REMOVED,
+ 	DEVICE_CARRIER_ON,
+diff -ruNp network-manager-0.6.2~/src/nm-device.c network-manager-0.6.2/src/nm-device.c
+--- network-manager-0.6.2~/src/nm-device.c	2006-03-21 17:56:34.000000000 +0000
++++ network-manager-0.6.2/src/nm-device.c	2006-04-03 18:14:06.000000000 +0100
+@@ -1445,6 +1445,7 @@ nm_device_deactivate (NMDevice *self)
+ 		NM_DEVICE_GET_CLASS (self)->deactivate (self);
+ 
+ 	nm_schedule_state_change_signal_broadcast (self->priv->app_data);
++	nm_dbus_schedule_device_status_change_signal (self->priv->app_data, self, NULL, DEVICE_DEACTIVATED);
+ }
+ 
+