Commit graph

42 commits

Author SHA1 Message Date
Dan Williams
228224a072 dhcp: don't leak dhclient config file contents when merging
If there was an existing dhclient config file, don't leak it when
merging to the new configuration.

Found by Mathieu Trudel-Lapierre <mathieu@canonical.com>
2012-05-23 12:58:05 -05:00
Jiří Klimeš
78dda3b093 core: unblock signals for child processes we spawn out of NM (rh #739836)
Commit 217c5bf6ac fixed processing of unix
signals: signals are blocked in all threads and a dedicated thread handles the
signals using sigwait().
However, the commit forgot that child processes inherit signal mask as well.
That is why we have to unblock signals for child processes we spawn from NM, so
that they can receive signals.
2012-05-21 15:00:51 +02:00
David Rothlisberger
acadb7da8b dhclient: pass DBUS_SYSTEM_BUS_ADDRESS environment variable
So that dhclient will, in turn, pass it to the action script
(the action script tries to send a DBus signal to NetworkManager
over the system bus).

Dhclient "execve"s the action script with a hand-constructed environment
that only includes specific variables, plus whatever is passed to
dhclient with "-e".

As far as I know, dhcpcd has no option equivalent to dhclient's "-e".
2011-11-09 11:17:04 -06:00
Kjartan Maraas
c2b4b9c1d7 build: fix return types (bgo #644665)
Some functions were returning FALSE or 0 instead of NULL.
2011-03-14 01:05:51 -05:00
Dan Williams
9917da2c71 dhcp: add DHCP lease release capability 2011-01-05 16:23:00 -06:00
Dan Williams
71adbcbb20 Revert "wimax: if the device is connected at startup, force it to disconnect"
This reverts commit 9c99066d6c.

Yay for finger-memory of git commit -a...
2011-01-05 15:38:03 -06:00
Dan Williams
9c99066d6c wimax: if the device is connected at startup, force it to disconnect
Otherwise it doesn't auto-scan and we get no network list.  As a later
optimization, we could detect this, call iwmx_sdk_get_connected_network()
to get the current NSP, match that up with a connection, and "assume"
the connection like we do for Ethernet devices.
2011-01-05 15:30:59 -06:00
Dan Williams
297e3c6463 dhclient: split out dhclient config merging and add testcases 2010-12-17 23:09:20 -06:00
Dan Williams
8b006f331d dhcp: add support for Fedora dhclient RFC3442 routes (rh #639935)
Add support for Fedora's dhclient's built-in RFC3442 classless static
routes format.

Since the Fedora format uses the same name as the dhcpcd format, we
need to refactor a bunch of the code to ensure we can distinguish
between the types.  Do this at runtime now by consolidating the
classless static routes parsing code into the DHCP Client base class
and rework the unit tests so that we can test all variations of the
classless static route parsing code at the same time.

This also fixes a bug with the dhcpcd classless static route
gateway handling that would return the wrong gateway address.

Many thanks to Jiri Popelka from Red Hat for the initial patch
and explanations.
2010-10-21 13:34:40 -05:00
Martin Pitt
61e86600d5 dhcp: fix uninitialized variable usage with dhcp3 2010-10-06 17:12:10 -05:00
Dan Williams
b80f31e191 trivial: typo fixes
Sent by a Debian user to Michael Biebl.  No other attribution
information available.  Thanks Debian user!
2010-09-25 00:34:10 -05:00
Mathieu Trudel-Lapierre
d39fda7722 dhcp: don't fail with dhclient v3 2010-08-12 17:52:20 -05:00
Michael Biebl
c8c161780a dhcp: use ISC DHCPv4 paths now that v4 is nominally required 2010-07-09 11:33:27 -07:00
Dan Williams
26312c087e core: simplify DHCP hostname handling
Reduce memory usage by not duplicating the IP4 setting.
2010-06-28 17:17:24 -07:00
Dan Williams
3d4b6163b9 dhcp: try /etc/dhcp too for !SUSE && !DEBIAN && !GENTOO (rh #607759) 2010-06-28 11:18:12 -07:00
Dan Williams
07de58bbeb dhcp: clean up client spawn return value 2010-05-01 09:53:49 -07:00
Dan Williams
75e789399c dhcp: update logging 2010-04-06 18:07:18 -07:00
Dan Williams
b7d21eba69 dhcp: print out DHCP client command strings 2010-03-23 18:50:32 -07:00
Dan Williams
78dd4fc9f2 dhcp: make client selection more forgiving
If your distributor forgot to set up the client path for you, this
makes NM look in the right places and allows you to use either client
if it's installed, no matter what NM was configured with.
2010-03-23 14:22:10 -07:00
Jirka Klimes
0f0daf7852 core: determine classful IPv4 prefix if no DHCP netmask is provided (bgo #603098) 2010-02-25 16:52:10 -08:00
Dan Williams
35c4b97d7d dhcp6: first stab at autoconf otherconf/managed mode support 2010-01-27 16:20:09 -08:00
Dan Williams
f094e0ad9d dhcp: dhclient leasefile and pidfile fixes for IPv6
Don't use the same lease and pid files for IPv6 as for IPv4.
2010-01-14 00:39:58 -08:00
Dan Williams
fe62e59c7e dhcp: add DHCPv6 functionality 2010-01-13 16:51:20 -08:00
Dan Williams
702836b42f dhcp: allow runtime DHCP client selection via config file 2010-01-12 22:55:24 -08:00
Dan Williams
1806235049 dhcp: convert dhcp backends to classes 2010-01-12 22:09:28 -08:00
Dan Williams
d997785db3 dhcp6: genericize DHCP client tracking
Since the same interface could be used for both	DHCPv4 and DHCPv6 we
can't just use 'iface' for tracking DHCP client lease changes.  Instead
use a generated client ID, and track DHCP events based on the client's
PID instead of interface name.
2010-01-08 17:16:05 -08:00
Frederik Himpe
f4c1a52876 dhcp: use correct leasefile location on Mandriva 2009-11-15 22:42:16 -08:00
Dan Williams
f2eb3dea65 core: base infrastructure for connection assumption
Figure out what connections can be assumed when a device is added,
and on shutdown don't blow away connections that can be assumed on
NM restart.
2009-08-03 17:15:03 -04:00
Daniel Drake
3fe8d0eed4 core: allow devices to specify a DHCP anycast address
Relevant only for OLPC at this point; the mesh device uses it to
target DHCP requests at a pre-defined mesh portal anycast address.
2009-07-15 13:53:49 -04:00
Dan Williams
b35aa0a022 dhcp: fix dhcp-client-identifier format for dhclient (bgo #588008) 2009-07-14 16:10:38 -04:00
Dan Williams
756bc70402 dhcp: (dhclient) use per-connection leasefiles and don't delete on deactivate
So that leases are actually useful...
2009-05-03 00:51:09 -04:00
Daniel Gryniewicz
20c662e350 dhcp: use correct dhclient config file location for Gentoo (bgo #579737) 2009-04-23 10:44:08 -04:00
Tambet Ingo
9742b46122 Fix the DHCP lease directory location for suse. 2009-03-16 11:17:34 +02:00
Dan Williams
68ca77cdb5 dhcp: always clean up DHCP client watch callback when stopping DHCP
Also fix a bug where failure to start the DHCP client wouldn't be
handled.
2009-02-18 09:57:33 -05:00
Dan Williams
f2e8870338 dhcp: handle classless static routes (bgo #567246)
Based on patches by Johan Bilien <jobi@via.ecp.fr>,
nick loeve <trickie@gmail.com>, and Roy Marples <roy@marples.name>
with significant changes for dhclient formatting and test cases.

Note that dhclient needs help before it can actually parse
classless static routes by adding the following to the
dhclient.conf file:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
2009-01-18 23:19:09 -05:00
Dan Williams
706118b9db Use correct dhclient leasefile location for Debian systems
Patch by Michael Biebl <mbiebl@debian.org>
2008-12-16 15:24:38 -05:00
Dan Williams
1b075023fa 2008-11-05 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-dhclient.c
		- (get_leasefile_for_iface): move lease files back to where dhclient
			puts them



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4267 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-05 17:18:13 +00:00
Dan Williams
525171d0d0 update license headers
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4257 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-04 22:30:08 +00:00
Dan Williams
bfb7243663 2008-10-29 Dan Williams <dcbw@redhat.com>
* libnm-util/libnm-util.ver
	  libnm-util/nm-setting-ip4-config.c
	  libnm-util/nm-setting-ip4-config.h
		- Make properties private and add accessor functions

	* callouts/nm-dispatcher-action.c
	  libnm-glib/libnm-glib-test.c
	  libnm-util/nm-utils.c
	  src/NetworkManagerPolicy.c
	  src/NetworkManagerSystem.c
	  src/NetworkManagerUtils.c
	  src/dhcp-manager/nm-dhcp-dhclient.c
	  src/dhcp-manager/nm-dhcp-manager.c
	  src/dnsmasq-manager/nm-dnsmasq-manager.c
	  src/nm-device-wifi.c
	  src/nm-device.c
	  src/nm-hso-gsm-device.c
	  src/nm-ip4-config.c
	  src/nm-ip4-config.h
	  src/ppp-manager/nm-ppp-manager.c
	  src/vpn-manager/nm-vpn-connection.c
	  system-settings/plugins/ifcfg-fedora/reader.c
	  system-settings/plugins/ifcfg-suse/parser.c
	  system-settings/plugins/ifcfg-suse/plugin.c
	  system-settings/plugins/ifupdown/parser.c
	  test/nm-tool.c
	  vpn-daemons/vpnc/properties/nm-vpnc.c
		- Use IP4 accessor functions



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4233 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-29 14:35:25 +00:00
Dan Williams
a5de3b4656 Include config.h for TARGET_*
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4046 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-09-08 18:10:39 +00:00
Dan Williams
7466136be2 2008-08-27 Dan Williams <dcbw@redhat.com>
Ensure zombie children get cleaned up.  To get notifications when children
	die abnormally, g_spawn_async() requires G_SPAWN_DO_NOT_REAP_CHILD, but
	that requires calling waitpid() yourself if you've removed the child watch
	handler before the process has actually died, which NM needs to do in a few
	places.  So ensure that everything uses G_SPAWN_DO_NOT_REAP_CHILD and also
	cleans up after the child when required.  Should fix problems trying to
	activate mobile broadband connections after a previous failure.

	* src/dhcp-manager/nm-dhcp-dhclient.c
	  src/dhcp-manager/nm-dhcp-dhcpcd.c
		- Use G_SPAWN_DO_NOT_REAP_CHILD

	* src/dhcp-manager/nm-dhcp-manager.c
		- (nm_dhcp_device_destroy): ensure child is cleaned up
		- (nm_dhcp_client_stop, nm_dhcp_manager_cancel_transaction_real): always
			block on child quitting, since the non-blocking functionality was
			never actually used

	* src/dnsmasq-manager/nm-dnsmasq-manager.c
		- (dm_watch_cb): child is already reaped here
		- (ensure_killed, nm_dnsmasq_manager_stop): block until child is dead

	* src/nm-device.c
		- (aipd_cleanup): block until child is dead

	* src/named-manager/nm-named-manager.c
		- (run_netconfig): don't use G_SPAWN_DO_NOT_REAP_CHILD if we aren't
			event bothering to watch the child

	* src/ppp-manager/nm-ppp-manager.c
		- (ppp_watch_cb): child is already reaped here
		- (ensure_killed, nm_ppp_manager_stop): block until child is dead

	* src/vpn-manager/nm-vpn-service.c
		- (vpn_service_watch_cb): child is already reaped here
		- (nm_vpn_service_daemon_exec): use G_SPAWN_DO_NOT_REAP_CHILD so that
			status of the child is actually tracked
		- (ensure_killed, finalize): block until child is dead



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4020 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-27 17:22:32 +00:00
Dan Williams
87e7e74e13 2008-07-16 Dan Williams <dcbw@redhat.com>
Patch from Roy Marples <roy@marples.name>

	* configure.in
		- Add --with-dhcp-client option

	* src/dhcp-manager/Makefile.am
		- pass DHCP_CLIENT_PATH on compile line

	* src/dhcp-manager/nm-dhcp-manager.c
	  src/dhcp-manager/nm-dhcp-manager.h
		- Genericize for both dhcpcd and dhclient

	* src/dhcp-manager/nm-dhcp-dhclient.c
		- Move dhclient stuff out to it's own file from nm-dhcp-manager.c

	* src/dhcp-manager/nm-dhcp-dhcpcd.c
		- Implement support for dhcpcd too



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3823 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-16 20:39:58 +00:00