nm-dhcp-manager.c 17.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* nm-dhcp-manager.c - Handle the DHCP daemon for NetworkManager
 *
 * Copyright (C) 2005 Dan Williams
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.  
 */


#include <glib.h>
#include <dbus/dbus.h>
#include "nm-dhcp-manager.h"
#include "NetworkManagerDevice.h"
#include "NetworkManagerPolicy.h"
#include "nm-activation-request.h"
#include "nm-utils.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>


struct NMDHCPManager
{
	NMData *		data;
	gboolean		running;
};


char *get_dhcp_match_string (const char *owner)
{
	g_return_val_if_fail (owner != NULL, NULL);

	return g_strdup_printf ("type='signal',interface='" DHCP_SERVICE_NAME ".state',sender='%s'", owner);
}


static gboolean state_is_bound (guint8 state)
{
	if (	   (state == 2)	/* BOUND */
		|| (state == 3)	/* RENEW */
		|| (state == 4)	/* REBOOT */
		|| (state == 5))	/* REBIND */
		return TRUE;

	return FALSE;
}


static gboolean state_is_down (guint8 state)
{
	if (	   (state == 0)	/* NBI */
		|| (state == 11)	/* RELEASE */
		|| (state == 13)	/* ABEND */
		|| (state == 14))	/* END */
		return TRUE;

	return FALSE;
}


/*
 * nm_dhcp_manager_exec_daemon
 *
 * Launch the DHCP daemon.
 *
 */
static gboolean nm_dhcp_manager_exec_daemon (NMDHCPManager *manager)
{
	GPtrArray		*dhcp_argv;
	GError		*error = NULL;
	GPid			 pid;

	g_return_val_if_fail (manager != NULL, FALSE);

	dhcp_argv = g_ptr_array_new ();
88
	g_ptr_array_add (dhcp_argv, DHCDBD_BINARY_PATH);
89
90
91
92
93
94
	g_ptr_array_add (dhcp_argv, "--system");
	g_ptr_array_add (dhcp_argv, NULL);

	if (!g_spawn_async ("/", (char **) dhcp_argv->pdata, NULL, 0, NULL, NULL, &pid, &error))
	{
		g_ptr_array_free (dhcp_argv, TRUE);
95
		nm_warning ("Could not activate the DHCP daemon " DHCDBD_BINARY_PATH ".  error: '%s'.", error->message);
96
97
98
99
		g_error_free (error);
		return FALSE;
	}
	g_ptr_array_free (dhcp_argv, TRUE);
100
	nm_info ("Activated the DHCP daemon " DHCDBD_BINARY_PATH " with PID %d.", pid);
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

	return TRUE;
}


NMDHCPManager * nm_dhcp_manager_new (NMData *data)
{
	NMDHCPManager *	manager;
	char *			owner;

	g_return_val_if_fail (data != NULL, NULL);
	g_return_val_if_fail (data->dbus_connection != NULL, NULL);

	manager = g_malloc0 (sizeof (NMDHCPManager));
	manager->data = data;
	manager->running = dbus_bus_name_has_owner (manager->data->dbus_connection, DHCP_SERVICE_NAME, NULL);

	if (manager->running && (owner = get_name_owner (data->dbus_connection, DHCP_SERVICE_NAME)))
	{
		char *match = get_dhcp_match_string (owner);
		dbus_bus_add_match (data->dbus_connection, match, NULL);
		g_free (match);
		g_free (owner);
	}

	return manager;
}


void nm_dhcp_manager_dispose (NMDHCPManager *manager)
{
	g_return_if_fail (manager != NULL);

	memset (manager, 0, sizeof (NMDHCPManager));
	g_free (manager);
}


guint8 nm_dhcp_manager_get_state_for_device (NMDHCPManager *manager, NMDevice *dev)
{
	DBusMessage *	message;
	DBusMessage *	reply;
	char *		path;
	guint8		state = 0;
	DBusError		error;

	g_return_val_if_fail (manager != NULL, 0);
	g_return_val_if_fail (dev != NULL, 0);

	if (!manager->running)
	{
		if (nm_dhcp_manager_exec_daemon (manager) == FALSE)
			return 0;
		sleep (1);
	}

	path = g_strdup_printf (DHCP_OBJECT_PATH"/%s", nm_device_get_iface (dev));
	message = dbus_message_new_method_call (DHCP_SERVICE_NAME, path, DHCP_SERVICE_NAME".dbus.get", "reason");
	g_free (path);
	if (message == NULL)
	{
		nm_warning ("nm_dhcp_manager_get_state_for_device(): Couldn't allocate the dbus message");
		return 0;
	}

	dbus_error_init (&error);
	reply = dbus_connection_send_with_reply_and_block (manager->data->dbus_connection, message, -1, &error);
	dbus_message_unref (message);
	if (dbus_error_is_set (&error))
	{
171
172
		if (strcmp (error.name, "org.freedesktop.DBus.Error.UnknownMethod") != 0)
			nm_info ("Error from dhcdbd on 'reason' request because: name '%s', message '%s'.", error.name, error.message);
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
		dbus_error_free (&error);
	}
	if (reply)
	{
		if (!dbus_message_get_args (reply, &error, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID))
			state = 0;
		dbus_message_unref (reply);
	}

	return state;
}


/*
 * nm_dhcp_manager_handle_timeout
 *
 * Called after timeout of a DHCP transaction to notify device of the failure.
 *
 */
gboolean nm_dhcp_manager_handle_timeout (NMActRequest *req)
{
	NMData *		data;
	NMDevice *	dev;

	g_return_val_if_fail (req != NULL, FALSE);

	data = nm_act_request_get_data (req);
	g_assert (data);

	dev = nm_act_request_get_dev (req);
	g_assert (dev);

	nm_info ("Device '%s' DHCP transaction took too long (>25s), stopping it.", nm_device_get_iface (dev));

207
	if (nm_act_request_get_stage (req) == NM_ACT_STAGE_IP_CONFIG_START)
208
209
210
	{
		nm_act_request_set_dhcp_timeout (req, 0);
		nm_dhcp_manager_cancel_transaction (data->dhcp_manager, req);
211
		nm_device_activate_schedule_stage4_ip_config_timeout (req);
212
213
214
215
216
217
218
219
220
221
222
223
224
225
	}

	return FALSE;
}


gboolean nm_dhcp_manager_begin_transaction (NMDHCPManager *manager, NMActRequest *req)
{
	DBusError			error;
	DBusMessage *		message;
	DBusMessage *		reply;
	NMDevice *		dev;
	char *			path;
	const guint32		opt1 = 31;	/* turns off ALL actions and dhclient-script just writes options to dhcdbd */
226
	const guint32		opt2 = 2;		/* dhclient is run in ONE SHOT mode and releases existing leases when brought down */
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
	GSource *			source;

	g_return_val_if_fail (manager != NULL, FALSE);
	g_return_val_if_fail (req != NULL, FALSE);

	if (!manager->running)
	{
		if (nm_dhcp_manager_exec_daemon (manager) == FALSE)
			return FALSE;
		sleep (1);
	}
	else
	{
		/* Cancel any DHCP transaction already in progress */
		nm_dhcp_manager_cancel_transaction (manager, req);
		/* FIXME don't sleep */
		sleep (1);
	}

	dev = nm_act_request_get_dev (req);
	g_assert (dev);

	nm_info ("Activation (%s) Beginning DHCP transaction.", nm_device_get_iface (dev));

	path = g_strdup_printf (DHCP_OBJECT_PATH"/%s", nm_device_get_iface (dev));
	message = dbus_message_new_method_call (DHCP_SERVICE_NAME, path, DHCP_SERVICE_NAME, "up");
	g_free (path);
	if (message == NULL)
	{
		nm_warning ("nm_dhcp_manager_begin_transaction(): Couldn't allocate the dbus message");
		return FALSE;
	}

	dbus_message_append_args (message, DBUS_TYPE_UINT32, &opt1, DBUS_TYPE_UINT32, &opt2, DBUS_TYPE_INVALID);
	dbus_error_init (&error);
262
263
264
	if ((reply = dbus_connection_send_with_reply_and_block (manager->data->dbus_connection, message, -1, &error)))
		dbus_message_unref (reply);
	dbus_message_unref (message);
265
266
267
268
	if (dbus_error_is_set (&error))
	{
		nm_info ("Couldn't send DHCP 'up' message because: name '%s', message '%s'.", error.name, error.message);
		dbus_error_free (&error);
269
		return FALSE;
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
	}

	/* Set up a timeout on the transaction to kill it after 25s */
	source = g_timeout_source_new (25000);
	g_source_set_callback (source, (GSourceFunc) nm_dhcp_manager_handle_timeout, req, NULL);
	nm_act_request_set_dhcp_timeout (req, g_source_attach (source, manager->data->main_context));
	g_source_unref (source);

	return TRUE;
}


static void remove_timeout (NMDHCPManager *manager, NMActRequest *req)
{
	guint id;

	g_return_if_fail (manager != NULL);
	g_return_if_fail (req != NULL);

	/* Remove any pending timeouts on the request */
	if ((id = nm_act_request_get_dhcp_timeout (req)) > 0)
	{
		GSource *	source = g_main_context_find_source_by_id (manager->data->main_context, id);
		nm_act_request_set_dhcp_timeout (req, 0);
		g_source_destroy (source);
	}
}

/*
 * nm_dhcp_manager_cancel_transaction
 *
 * Stop any in-progress DHCP transaction on a particular device.
 *
 */
void nm_dhcp_manager_cancel_transaction (NMDHCPManager *manager, NMActRequest *req)
{
	NMDevice *dev;

	g_return_if_fail (manager != NULL);
	g_return_if_fail (req != NULL);

	dev = nm_act_request_get_dev (req);
	g_assert (dev);

	if (manager->running && !state_is_down (nm_act_request_get_dhcp_state (req)))
	{
		guint		id;
		DBusMessage *	message;
		char *		path = g_strdup_printf (DHCP_OBJECT_PATH"/%s", nm_device_get_iface (dev));

		if ((message = dbus_message_new_method_call (DHCP_SERVICE_NAME, path, DHCP_SERVICE_NAME, "down")))
		{
			dbus_connection_send (manager->data->dbus_connection, message, NULL);
			dbus_message_unref (message);
		}
		g_free (path);

		remove_timeout (manager, req);
	}
}


static gboolean get_ip4_uint32s (NMDHCPManager *manager, NMDevice *dev, const char *item, guint32 **ip4_uint32, guint32 *num_items)
{
	DBusMessage *	message = NULL;
	DBusMessage *	reply = NULL;
	char *		path;
	gboolean		success = FALSE;

	g_return_val_if_fail (manager != NULL, FALSE);
	g_return_val_if_fail (dev != NULL, FALSE);
	g_return_val_if_fail (ip4_uint32 != NULL, FALSE);
	g_return_val_if_fail (num_items != NULL, FALSE);

	*ip4_uint32 = NULL;
	*num_items = 0;
	path = g_strdup_printf (DHCP_OBJECT_PATH"/%s", nm_device_get_iface (dev));
	if ((message = dbus_message_new_method_call (DHCP_SERVICE_NAME, path, DHCP_SERVICE_NAME".dbus.get", item)))
	{
		DBusError	error;

		dbus_error_init (&error);
		reply = dbus_connection_send_with_reply_and_block (manager->data->dbus_connection, message, -1, &error);
		if (reply)
		{
			GArray *buffer;
			DBusMessageIter iter;

			dbus_message_iter_init (reply, &iter);

			buffer = g_array_new (TRUE, TRUE, sizeof (guint32));
			while (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_UINT32)
			{
				guint32 value;
			
				dbus_message_iter_get_basic (&iter, &value);
				g_array_append_val (buffer, value);
				dbus_message_iter_next (&iter);
				success = TRUE;
			}

			if (success)
			{
				*ip4_uint32 = (guint32 *)(buffer->data);
				*num_items = buffer->len;
			}
			g_array_free (buffer, FALSE);
			dbus_message_unref (reply);
		}

		if (dbus_error_is_set (&error))
		{
			nm_warning ("get_ip4_uint32(): error calling '%s', DHCP daemon returned error '%s', message '%s'.", item, error.name, error.message);
			dbus_error_free (&error);
		}
		dbus_message_unref (message);
	}
	g_free (path);

	return success;
}


static gboolean get_ip4_string (NMDHCPManager *manager, NMDevice *dev, const char *item, char **string)
{
	DBusMessage *	message = NULL;
	DBusMessage *	reply = NULL;
	char *		path;
	gboolean		success = FALSE;

	g_return_val_if_fail (manager != NULL, FALSE);
	g_return_val_if_fail (dev != NULL, FALSE);
	g_return_val_if_fail (string != NULL, FALSE);

	*string = NULL;
	path = g_strdup_printf (DHCP_OBJECT_PATH"/%s", nm_device_get_iface (dev));
	if ((message = dbus_message_new_method_call (DHCP_SERVICE_NAME, path, DHCP_SERVICE_NAME".dbus.get", item)))
	{
		DBusError	error;

		dbus_error_init (&error);
		if ((reply = dbus_connection_send_with_reply_and_block (manager->data->dbus_connection, message, -1, &error)))
		{
			char *dbus_string;

			dbus_error_init (&error);
			if (dbus_message_get_args (reply, &error, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID))
			{
				*string = g_strdup (dbus_string);
				success = TRUE;
			}
		}

		if (dbus_error_is_set (&error))
		{
			nm_warning ("get_ip4_string(): error calling '%s', DHCP daemon returned error '%s', message '%s'.", item, error.name, error.message);
			dbus_error_free (&error);
			*string = NULL;
		}
		dbus_message_unref (message);
	}
	g_free (path);

	return success;
}


/*
 * nm_dhcp_manager_get_ip4_config
 *
 * Get IP4 configuration values from the DHCP daemon
 *
 */
NMIP4Config * nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager, NMActRequest *req)
{
	NMDevice *	dev;
	NMIP4Config *	ip4_config = NULL;
	int			i;
	guint32		count = 0;
	guint32 *		ip4_address = NULL;
	guint32 *		ip4_netmask = NULL;
	guint32 *		ip4_broadcast = NULL;
	guint32 *		ip4_nameservers = NULL;
	guint32 *		ip4_gateway = NULL;
	guint32		num_ip4_nameservers = 0;
	char *		domain_names = NULL;
	struct in_addr	temp_addr;

	g_return_val_if_fail (manager != NULL, NULL);
	g_return_val_if_fail (req != NULL, NULL);

	if (!manager->running)
		return NULL;

	dev = nm_act_request_get_dev (req);
	g_assert (dev);

	if (!state_is_bound (nm_act_request_get_dhcp_state (req)))
	{
		nm_warning ("Tried to get IP4 Config for a device when dhcdbd wasn't in a BOUND state!");
		return NULL;
	}

	if (!get_ip4_uint32s (manager, dev, "ip_address", &ip4_address, &count) || !count)
		goto out;

	if (!get_ip4_uint32s (manager, dev, "subnet_mask", &ip4_netmask, &count) || !count)
		goto out;

	if (!get_ip4_uint32s (manager, dev, "broadcast_address", &ip4_broadcast, &count) || !count)
		goto out;

	if (!get_ip4_uint32s (manager, dev, "routers", &ip4_gateway, &count) || !count)
		goto out;

	if (!get_ip4_uint32s (manager, dev, "domain_name_servers", &ip4_nameservers, &num_ip4_nameservers) || !num_ip4_nameservers)
		goto out;

	get_ip4_string (manager, dev, "domain_name", &domain_names);
		
	nm_info ("Retrieved the following IP4 configuration from the DHCP daemon:");

	ip4_config = nm_ip4_config_new ();
	nm_ip4_config_set_address (ip4_config, ip4_address[0]);
	temp_addr.s_addr = ip4_address[0];
	nm_info ("  address %s", inet_ntoa (temp_addr));

	nm_ip4_config_set_netmask (ip4_config, ip4_netmask[0]);
	temp_addr.s_addr = ip4_netmask[0];
	nm_info ("  netmask %s", inet_ntoa (temp_addr));

	nm_ip4_config_set_broadcast (ip4_config, ip4_broadcast[0]);
	temp_addr.s_addr = ip4_broadcast[0];
	nm_info ("  broadcast %s", inet_ntoa (temp_addr));

	nm_ip4_config_set_gateway (ip4_config, ip4_gateway[0]);
	temp_addr.s_addr = ip4_gateway[0];
	nm_info ("  gateway %s", inet_ntoa (temp_addr));

	for (i = 0; i < num_ip4_nameservers; i++)
	{
		nm_ip4_config_add_nameserver (ip4_config, ip4_nameservers[i]);
		temp_addr.s_addr = ip4_nameservers[i];
		nm_info ("  nameserver %s", inet_ntoa (temp_addr));
	}

	if (domain_names)
	{
		char **searches = g_strsplit (domain_names, " ", 0);
		char **s;

		for (s = searches; *s; s++)
		{
			nm_info ("  domain name '%s'", *s);
			nm_ip4_config_add_domain (ip4_config, *s);
		}
		g_strfreev (searches);
	}

out:
	return ip4_config;
}


/*
 * nm_dhcp_manager_process_signal
 *
 * Possibly process a signal from the bus, if it comes from the currently
 * active DHCP daemon, if any.  Return TRUE if processed, FALSE if not.
 *
 */
gboolean nm_dhcp_manager_process_signal (NMDHCPManager *manager, DBusMessage *message)
{
	const char *		object_path;
	const char *		member;
	const char *		interface;
	const char *		temp_op;
	const char *		service_name;
	gboolean			handled = FALSE;
	NMDevice *		dev;
	NMActRequest *		req = NULL;

	g_return_val_if_fail (manager != NULL, FALSE);
	g_return_val_if_fail (message != NULL, FALSE);

	if (!(object_path = dbus_message_get_path (message)))
		return FALSE;
	if (!(member = dbus_message_get_member (message)))
		return FALSE;
	if (!(interface = dbus_message_get_interface (message)))
		return FALSE;

	/* nm_info ("nm_dhcp_manager_process_signal(): got signal op='%s' member='%s' interface='%s'", object_path, member, interface); */

	dev = nm_get_device_by_iface (manager->data, member);
	if (dev && (req = nm_device_get_act_request (dev)))
	{
		if (dbus_message_is_signal (message, "com.redhat.dhcp.state", nm_device_get_iface (dev)))
		{
			guint8	state;

			if (dbus_message_get_args (message, NULL, DBUS_TYPE_BYTE, &state, DBUS_TYPE_INVALID))
			{
				nm_info ("DHCP daemon state now %d for interface %s", state, nm_device_get_iface (dev));
				switch (state)
				{
					case 2:		/* BOUND */
					case 3:		/* RENEW */
					case 4:		/* REBOOT */
					case 5:		/* REBIND */
580
						if (nm_act_request_get_stage (req) == NM_ACT_STAGE_IP_CONFIG_START)
581
582
583
584
585
586
587
						{
							nm_device_activate_schedule_stage4_ip_config_get (req);
							remove_timeout (manager, req);
						}
						break;

					case 8:		/* TIMEOUT - timed out trying to contact server */
588
						if (nm_act_request_get_stage (req) == NM_ACT_STAGE_IP_CONFIG_START)
589
590
591
592
593
594
595
596
						{
							nm_device_activate_schedule_stage4_ip_config_timeout (req);
							remove_timeout (manager, req);
						}
						break;					

					case 9:		/* FAIL */
					case 13:		/* ABEND */
597
//					case 14:		/* END */
598
						if (nm_act_request_get_stage (req) == NM_ACT_STAGE_IP_CONFIG_START)
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
						{
							nm_policy_schedule_activation_failed (req);
							remove_timeout (manager, req);
						}
						break;

					default:
						break;
				}
				nm_act_request_set_dhcp_state (req, state);
			}

			handled = TRUE;
		}
	}

	return handled;
}


/*
 * nm_dhcp_manager_process_name_owner_changed
 *
 * Respond to "service created"/"service deleted" signals from dbus for the active DHCP daemon.
 *
 */
gboolean nm_dhcp_manager_process_name_owner_changed (NMDHCPManager *manager, const char *changed_service_name, const char *old_owner, const char *new_owner)
{
	gboolean	handled = FALSE;
	gboolean	old_owner_good = (old_owner && strlen (old_owner));
	gboolean	new_owner_good = (new_owner && strlen (new_owner));

	g_return_val_if_fail (manager != NULL, FALSE);
	g_return_val_if_fail (changed_service_name != NULL, FALSE);

	/* Can't handle the signal if its not from the DHCP service */
	if (strcmp (DHCP_SERVICE_NAME, changed_service_name) != 0)
		return FALSE;

	if (!old_owner_good && new_owner_good)
	{
		char *match = get_dhcp_match_string (new_owner);

		/* DHCP service got created */
		dbus_bus_add_match (manager->data->dbus_connection, match, NULL);
		g_free (match);

		manager->running = TRUE;
		handled = TRUE;
	}
	else if (old_owner_good && !new_owner_good)
	{
		char *match = get_dhcp_match_string (old_owner);

		/* DHCP service went away */
		dbus_bus_remove_match (manager->data->dbus_connection, match, NULL);
		g_free (match);

		manager->running = FALSE;
		handled = TRUE;
	}

	return handled;
}