Commit Graph

50 Commits

Author SHA1 Message Date
Dan Williams
ea05e90016 ethernet: fix debug log message 2010-04-08 15:00:32 -07:00
Dan Williams
d0f2a50680 core: log kernel interface indexes 2010-04-08 09:30:05 -07:00
Dan Williams
8364ce7bac wired: debug logging for carrier detect support detection 2010-04-08 09:22:52 -07:00
Dan Williams
5eeef57581 wired: update logging 2010-04-07 13:24:25 -07:00
Dan Williams
9e627d1bce trivial: rename some CamelCase source files to not-camel-case 2010-03-02 15:06:14 -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
Dan Williams
d6799281e1 ethernet: remove unused variable 2009-12-23 11:09:22 -08:00
Dan Williams
830bded555 ppp: increase PPPoE pppd timeout to 30 seconds
Mostly to help debug stuff like (rh #528314) where it's hanging somewhere
in rp-pppoe while trying to connect to the access concentrator.
2009-11-23 00:08:35 -08:00
Dan Williams
ea78b0af0e core: don't leak 'ifindex' into PropertiesChanged signal
It's not part of the D-Bus spec; so it shouldn't be exposed.
2009-11-03 17:40:36 -08:00
Alexander Sack
82011dff04 ppp: allow update of ppp secrets in all ACTIVATING stages (lp:432205)
Previously, ppp code would flip device state to _NEED_AUTH before
asking for secrets update; this is not the case anymore after landing
of f28a0df4a66e8f6c98327691c9c90df0604bbd28; hence, we need to
allow update of secrets in all ACTIVATING stages.

This patch updates this behaviour for all device classes with ppp
support.
2009-10-30 19:58:30 +01:00
Frej Soya
e3ae3efc09 wired: fix build_supplicant_config for wired - bgo:594038 lp:422597 2009-10-05 11:22:20 +02:00
Dan Williams
963d055abf wired: defer carrier-off events while connected by a few seconds
Don't immediately tear down an active wired connection when the carrier
flips to off, but wait a few seconds for it to come back before breaking
the user's network.
2009-09-28 14:12:09 -07:00
Dan Williams
a2c1256215 wired: link_timeout_id -> supplicant_timeout_id 2009-09-28 12:57:18 -07:00
Dan Williams
0bbf8c5307 ethernet: make initial carrier check synchronous; require carrier for connection takeover (lp#417719) 2009-09-28 11:09:31 -07:00
Dan Williams
7a2e2cfda3 core: rename nm_device_can_activate -> nm_device_is_available
Becuase when the device is in >= DISCONNECTED state, that already
means it can activate if a connection is available.
2009-09-14 13:33:06 -07:00
Dan Williams
393bdd3737 core: generalize unavailable -> disconnected delayed transition
Instead of doing this in every device subclass, do it in the NMDevice
superclass.  nm_device_can_activate() already did the same logic that
each of the subclass device_state_changed() handlers were doing to
figure out whether they could do the transition from unavailable
to disconnected, so just use that in NMDevice and kill lots of code.
2009-09-14 13:24:29 -07:00
Dan Williams
0be66daa9a wired: get rid of nm_device_ethernet_get_carrier
Only used internally; just use priv->carrier instead
2009-09-14 12:54:09 -07:00
Dan Williams
ab167b1994 ethernet: clean up netlink monitoring code
Keep a reference to the netlink monitor for as long as we have
signals attached to it.  Also don't bother looking up the ifindex
in the carrier state signal handlers since we already have it
lying around in priv.
2009-09-14 12:15:15 -07:00
Dan Williams
f28a0df4a6 ppp: ignore certain pppd status changes
We don't actually care when pppd goes into the 'network' phase or the
'authenticate' phase, because we're looking for the IP4 configuration
to come back, and the device is already in the IP_CONFIG state.
Handling those phases would cause the device's state to jump around
between NEED_AUTH and IP_CONFIG when we were already past that phase.

Specifically, when the PPP link went down, the device would jump from
FAILED to IP_CONFIG because pppd entered the 'network' phase when
cleaning up the link.  The device would also jump from IP_CONFIG to
NEED_AUTH during the connection process when we already had secrets.
2009-09-09 07:44:21 -07:00
Dan Williams
c2fb1f850a gsm/bt: fix merge of user-defined IPv4 settings 2009-08-17 19:48:42 -05:00
Dan Williams
3e221833da ppp: start PPP at activation stage3 instead of stage2
With the addition of IPv6, both v4 and v6 configuration are run in
parallel, and when both have finished, then activation can proceed.
Unfortunately, two of the 3 users of PPP (PPPoE and 3G) ran PPP at
stage2, and when the PPP IPv4 config was received, jumped directly
to activation stage4.  That caused the IPv6 code never to run, and
thus we hung at stage4 waiting for it to complete when nothing had
started it in the first place.

Instead, move PPP to stage3 so that
nm_device_activate_stage3_ip_config_start() can kick off both v4
and v6 IP code and we can successfully complete IP configuration
in all cases.  PPP previously being in stage2 was an artifact of
the more simplistic pre-IPv6 configuration code where it didn't
matter if you skipped stage3.
2009-08-17 15:35:02 -05:00
Dan Williams
4802094985 Merge commit 'origin/master' into iscsi 2009-08-05 15:46:11 -04: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
Dan Winship
fc8e609784 Initial IPv6 support (only handles "manual" and "ignore" currently) 2009-07-29 21:35:01 -04:00
Dan Williams
b62ff36e33 core: get rid of nm_device_set_device_type() 2009-07-07 14:57:05 -04:00
Dan Williams
9b8d8fe8df ethernet: remove unused code 2009-07-07 14:39:08 -04:00
Dan Williams
fa2bde265e core: kill nm_print_device_capabilities() 2009-07-07 14:38:55 -04:00
Dan Williams
3cdb0f6c7a core: add a 'type-desc' property to NMDeviceInterface and use it
instead of littering the code with NM_IS_*.
2009-07-07 14:24:12 -04:00
Dan Williams
c9067d8fed everything: use libgudev instead of HAL; merge NM and nm-system-settings
The only thing that doesn't work yet is the system-settings service's
"auto eth" connections for ethernet devices that don't have an existing
connection.  Might also have issues with unmanaged devices that can't
provide a MAC address until they are brought up, but we'll see.
2009-06-11 00:39:12 -04:00
Jan Kantert
4ca66db721 Use g_timeout_add_seconds() to reduce wakeups
(and refine the older glib compat mechanism, by Dan)
2008-12-31 18:57:36 -05:00
Dan Williams
24e50f7f6f 2008-11-02 Dan Williams <dcbw@redhat.com>
* Add license headers to everything in src/



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4247 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-03 04:13:42 +00:00
Dan Williams
4129798d51 2008-10-30 Dan Williams <dcbw@redhat.com>
* src/nm-device-ethernet.c
	  src/nm-device-wifi.c
	  src/nm-device.c
	  src/ppp-manager/nm-ppp-manager.c
		- Harmonize return checking of ioctl

	* system-settings/plugins/ifcfg-fedora/reader.c
		- (is_wireless_device): fall back to SIOCGIWNAME (rh #466340)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4236 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-30 05:52:20 +00:00
Dan Williams
b955a8197e 2008-10-30 Dan Williams <dcbw@redhat.com>
Patch from Alexander Sack <asac@canonical.com>

	Fix "ppp connections don't honour ip4 connection settings"

	* src/nm-device-ethernet.c
		- (real_act_stage4_get_ip4_config): merge ip4config settings
			with results from ppp manager

	* src/nm-serial-device.c
		- (real_act_stage4_get_ip4_config): merge ip4config settings
			with results from ppp manager



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4234 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-30 04:31:29 +00:00
Tambet Ingo
efdf6bab77 2008-10-27 Tambet Ingo <tambet@gmail.com>
* src/nm-device-ethernet.c (nm_device_ethernet_get_speed): Implement
	correct speed reporting for fast devices (kernel >= 2.6.27).

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4226 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-27 10:50:21 +00:00
Dan Williams
7d723b54a4 2008-10-26 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo <tambet@gmail.com>

	* libnm-util/libnm-util.ver
	  libnm-util/nm-setting-connection.c
	  libnm-util/nm-setting-connection.h
		- Make properties private and add accessor functions

	* src/NetworkManagerPolicy.c
	  src/nm-cdma-device.c
	  src/nm-device-ethernet.c
	  src/nm-device-interface.c
	  src/nm-device-wifi.c
	  src/nm-gsm-device.c
	  src/nm-manager.c
	  src/ppp-manager/nm-ppp-manager.c
	  src/vpn-manager/nm-vpn-connection.c
	  system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c
	  system-settings/plugins/ifcfg-fedora/plugin.c
	  system-settings/plugins/ifcfg-fedora/reader.c
	  system-settings/plugins/ifcfg-suse/parser.c
	  system-settings/plugins/ifupdown/parser.c
	  system-settings/plugins/keyfile/nm-keyfile-connection.c
	  system-settings/plugins/keyfile/plugin.c
	  system-settings/plugins/keyfile/writer.c
	  system-settings/src/main.c
		- Use those accessors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4220 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-26 17:41:37 +00:00
Dan Williams
55fd788e5a 2008-10-26 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo <tambet@gmail.com>

	* libnm-util/libnm-util.ver
	  libnm-util/nm-setting-pppoe.c
	  libnm-util/nm-setting-pppoe.h
		- Make properties private and add accessor functions

	* src/nm-device-ethernet.c
	  src/ppp-manager/nm-ppp-manager.c
		- Use those accesors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4217 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-26 17:08:58 +00:00
Dan Williams
fff2e85bd6 2008-10-26 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo <tambet@gmail.com>

	* libnm-util/libnm-util.ver
	  libnm-util/nm-setting-wired.c
	  libnm-util/nm-setting-wired.h
		- Make properties private and add accessor functions

	* src/nm-device-ethernet.c
	  system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c
	  system-settings/plugins/ifcfg-suse/parser.c
	  system-settings/src/main.c
		- Use those accessors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4215 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-26 17:02:05 +00:00
Dan Williams
1cb9bacaad 2008-10-26 Dan Williams <dcbw@redhat.com>
* src/supplicant-manager/nm-supplicant-interface.c
	  src/supplicant-manager/nm-supplicant-interface.h
	  src/supplicant-manager/nm-supplicant-manager.c
	  src/supplicant-manager/nm-supplicant-manager.h
		- Add state-to-string conversion functions

	* src/nm-device-wifi.c
	  src/nm-device-ethernet.c
		- Normalize state info logging and use strings instead of numbers



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4213 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-26 16:32:29 +00:00
Dan Williams
f029b6f4e9 2008-10-22 Dan Williams <dcbw@redhat.com>
* include/NetworkManager.h
	  introspection/nm-device.xml
		- Add device state change reason for carrier changes

	* src/nm-device-ethernet.c
		- (set_carrier): use the carrier change reason when changing device
			state in response to carrier changes



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4203 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-22 13:35:07 +00:00
Dan Williams
175d6db3ef 2008-10-02 Dan Williams <dcbw@redhat.com>
* src/ppp-manager/nm-ppp-manager.c
	  src/ppp-manager/nm-ppp-manager.h
		- (impl_ppp_manager_need_secrets): tries secrets twice before asking
			the settings daemon for completely new ones
		- (create_pppd_cmd_line): new parameter 'ppp_name' used to set the
			local PPP peer name; allow PPP debuging by launching NM with
			the environment variable NM_PPP_DEBUG defined
		- (nm_ppp_manager_start): new parameter 'ppp_name' passed to
			create_pppd_cmd_line()

	* src/nm-serial-device.c
	  src/nm-serial-device.h
		- New 'get_ppp_name' function for subclasses to implement to return the
			local PPP peer name
		- (real_act_stage2_config): call 'get_ppp_name' function of subclasses
			and pass that name to the PPP manager

	* src/nm-device-ethernet.c
		- (pppoe_stage2_config): pass the PPPoE username to the PPP manager as
			the local peer name

	* src/nm-cdma-device.c
		- (real_get_ppp_name): implement using the CDMA username



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4141 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-10-02 17:10:00 +00:00
Dan Williams
79256975d1 2008-09-25 Dan Williams <dcbw@redhat.com>
Fix bgo #549401 (inspired by patch from Alexander Sack)

	* src/nm-device-ethernet.c
		- (finish_supplicant_task): clean up scheduled tasks and free memory
		- (remove_supplicant_interface_error_handler): remove the supplicant
			error idle callback too
		- (supplicant_interface_release): rename from supplicant_interface_clean
			to match nm-device-wifi.c; clean up supplicant interface-related
			state tasks when the supplicant interface is disposed of
		- (schedule_state_handler): add scheduled tasks to a list so they can
			be cleaned up later
		- (supplicant_mgr_state_cb_handler, supplicant_iface_state_cb_handler,
		   supplicant_iface_connection_state_cb_handler): use
			finish_supplicant_task() to clean up each completed task
		- (supplicant_iface_connection_error_cb_handler,
		   supplicant_connection_timeout_cb): clear source id when the task is
			complete
		- (supplicant_iface_connection_error_cb): save scheduled task id for
			later cleanup
		- (nm_device_ethernet_dispose): clean up any pending supplicant state
			tasks

	* src/nm-device-wifi.c
		- (finish_supplicant_task): clean up scheduled tasks and free memory
		- (remove_supplicant_interface_error_handler): remove the supplicant
			error idle callback too
		- (supplicant_interface_release): clean up supplicant interface-related
			state tasks when the supplicant interface is disposed of
		- (schedule_state_handler): add scheduled tasks to a list so they can
			be cleaned up later
		- (supplicant_mgr_state_cb_handler, supplicant_iface_state_cb_handler,
		   supplicant_iface_connection_state_cb_handler): use
			finish_supplicant_task() to clean up each completed task
		- (supplicant_iface_connection_error_cb_handler): clear source id when
			the task is complete
		- (supplicant_iface_connection_error_cb): save scheduled task id for
			later cleanup
		- (nm_device_wifi_dispose): clean up any pending supplicant state tasks



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4105 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-09-25 10:02:28 +00:00
Dan Williams
0ab563c5ab Add required include
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4079 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-09-19 17:12:15 +00:00
Dan Williams
728dccd92c 2008-08-18 Dan Williams <dcbw@redhat.com>
* include/NetworkManager.h
	  introspection/nm-device.xml
		- Add a "missing firmware" device state reason

	* src/NetworkManagerSystem.c
	  src/NetworkManagerSystem.h
		- (nm_system_device_set_up_down): add a no_firmware argument
		- (nm_system_device_set_up_down_with_iface): if the result of setting
			IFF_UP is ENOENT, that almost always means missing firmware

	* src/backends/NetworkManagerGeneric.c
	  src/nm-device-ethernet.c
	  src/nm-device-private.h
	  src/nm-device-wifi.c
	  src/nm-device.c
	  src/nm-device.h
	  src/nm-hso-gsm-device.c
	  src/vpn-manager/nm-vpn-connection.c
		- Pass no_firmware along; check it where appropriate



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3983 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-18 18:29:47 +00:00
Dan Williams
cb79727fa2 2008-08-14 Dan Williams <dcbw@redhat.com>
* src/nm-netlink-monitor.c
	  src/nm-netlink-monitor.h
	  src/nm-device-ethernet.c
		- (nm_netlink_monitor_request_status): return an error on failure
		- (constructor): don't segfault on missing error



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3958 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-14 15:47:26 +00:00
Dan Williams
369299271a 2008-08-04 Dan Williams <dcbw@redhat.com>
Handle multiple concurrent PPP connections.

	* src/ppp-manager/nm-ppp-manager.c
	  src/ppp-manager/nm-ppp-manager.h
		- (constructor): only PPP Manager request bus name once; each
			NMPPPManager object gets a unique object path
		- (nm_ppp_manager_class_init, get_property, set_property,
		   nm_ppp_manager_new, nm_ppp_manager_start): pass parent interface in
			at construct time
		- (impl_ppp_manager_need_secrets, impl_ppp_manager_set_state): don't
			remove timeout until PPP manager gets an IP4 config
		- (create_pppd_cmd_line): pass dbus object path as 'ipparam' so that
			the plugin can call back to this specific PPP manager instance

	* src/nm-device-ethernet.c
	  src/nm-serial-device.c
		- Pass parent device in nm_ppp_manager_new()

	* src/nm-gsm-device.c
	  src/nm-cdma-device.c
	  	- (device_state_changed): don't close serial device on NEED_AUTH
	  		state changed, that's not a failure case like the rest are

	* src/ppp-manager/nm-pppd-plugin.c
		- (nm_ip_up): always use index 0 into the ipcp options, because NM always
			binds one interface to any pppd process, thus the correct index
			is always 0; send PHASE_DEAD on error to alert NM immediately of
			problems; try harder to get a peer address in spite of pppd
		- (plugin_init): use 'ipparam' as the object path back to our specific
			PPP manager instance



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3894 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-04 21:37:11 +00:00
Dan Williams
95bb76aa7f 2008-07-11 Dan Williams <dcbw@redhat.com>
Modify the NMDevice::state-changed signal to include the previous state
	and reason. Enables the applet to provide more information why device
	activation failed.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3819 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-11 10:28:53 +00:00
Dan Williams
8c79f16f5d 2008-07-01 Dan Williams <dcbw@redhat.com>
Fix mobile broadband username/password issues.  NM was never requesting
	mobile broadband secrets, nor was it passing back the username and password
	if it had them.

	* marshallers/nm-marshal.list
		- Add some new types for activation request objects

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (get_secrets_cb): pass the caller type in the signal
		- (nm_act_request_request_connection_secrets): take a caller type, so
			that GetSecrets() reply handlers know who asked for the secrets in
			the first place; use secret hints too so the settings service can
			figure out exactly what NM wants (ie, PIN or the PPP password)

	* src/ppp-manager/nm-ppp-manager.c
	  src/ppp-manager/nm-ppp-manager.h
		- (impl_ppp_manager_need_secrets): nm_connection_need_secrets() won't
			detect needed secrets when the secret could be blank, like GSM/CDMA
			passwords.  So always ask for secrets, and send a hint as to what
			secret we really want.
		- (nm_ppp_manager_update_secrets): make function more generic by making
			the device specific class figure out the username and password, and
			accept an error argument to return back over D-Bus

	* src/nm-device-wifi.c
		- (link_timeout_cb, handle_auth_or_fail): update for changes to
			nm_act_request_request_connection_secrets()
		- (real_connection_secrets_updated): update for 'caller' changes

	* src/nm-device.c
	  src/nm-device.h
		- (connection_secrets_updated_cb, connection_secrets_failed_cb): update
			for 'caller' changes

	* src/nm-device-ethernet.c
		- (real_connection_secrets_updated): update for 'caller' changes and
			move logic for getting PPPoE username and password here before
			calling nm_ppp_manager_update_secrets()
		- (link_timeout_cb, handle_auth_or_fail): update for changes to
			nm_act_request_request_connection_secrets()

	* src/nm-cdma-device.c
		- (real_connection_secrets_updated): pass username and password back
			to the PPP manager when required

	* src/nm-gsm-device.c
		- (enter_pin): send the required secret name to the settings service
		- (real_connection_secrets_updated): pass username and password back
			to the PPP manager when required



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3794 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-01 20:21:31 +00:00
Dan Williams
b0cf66eda8 2008-06-26 Dan Williams <dcbw@redhat.com>
* Update FSF address in license headers (Michael Biebl <biebl@debian.org>)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3775 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-26 18:31:52 +00:00
Dan Williams
2b00116361 2008-06-10 Dan Williams <dcbw@redhat.com>
The grand 802-3-ethernet rename.  Get rid of the 802-3/8023/802_3 bits.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3741 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-10 15:54:23 +00:00