* src/nm-gsm-device.c
- (schedule_automatic_registration_again): use a short timeout here
instead of an idle handler to avoid using too much CPU polling for
something we should be waiting a bit for anyway
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4205 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 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
* src/nm-manager.c
- (free_get_settings_info): don't use the DBusGProxy which could be
disposed of by the time the function is called
- (internal_new_connection_cb): save connection scope
- (connection_get_settings_cb): don't replace a connection unless it's
actually different from the existing one; fixes an issue where
killing the settings service wouldn't deactivate an active connection
provided by that settings service, because it was using a connection
that had already been replaced in the system or user hash
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4200 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManager.c
- (main): keep the DHCP manager around since it's a singleton; fixes
a use-after-free exposed by r4196 since the DHCP manager singleton
variable isn't cleared when the DHCP manager object is finalized
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4199 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get): fix mismatched refcount; creating the dhcp
manager object already refs it once
- (nm_dhcp_manager_cancel_transaction_real): clear freed variables that
also get cleaned up by nm_dhcp_device_destroy() to prevent
double-frees
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4196 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-glib/nm-settings.c
libnm-glib/nm-settings.h
- Rename the "get_secrets" virtual function "service_get_secrets" to
clarify when it's used; NMExportedConnetion is a base-class for both
the client and service side, which is sort of confusing, and
get_secrets only makes sense on the service side.
* libnm-glib/nm-dbus-connection.c
- (get_secrets): remove, unused, and clients need to do extra work to
get secrets anyway since the call can block on the remote side
* system-settings/plugins/ifupdown/nm-ifupdown-connection.c
system-settings/plugins/keyfile/nm-keyfile-connection.c
- Fix up for get_secrets -> service_get_secrets
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4192 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManagerSystem.c
- (ip4_dest_in_same_subnet): tighter checks on subnet matching,
if the ip4_dest is in a smaller subnet contained within a subnet
the machine is currently on, the destination is in the same subnet
- (nm_system_device_set_ip4_route): move subnet checks to callers
- (add_vpn_gateway_route): check if the VPN gateway is in the same
subnet as the parent device, and if so, don't add the direct
host route via the parent device's gateway (bgo #481620)
- (nm_system_apply_ip4_config): check whether the route to be added
is contained within a subnet the device is already on
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4181 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* include/NetworkManager.h
introspection/nm-device.xml
include/NetworkManagerVPN.h
- Add a few more state reasons for the device deactivated state
* src/nm-device-interface.c
src/nm-device-interface.h
- (nm_device_interface_deactivate): add a 'reason' argument
* src/nm-device.c
src/nm-device.h
- (nm_device_deactivate, nm_device_take_down): add a 'reason' argument
- (nm_device_state_changed): pass the state change reason to
nm_device_take_down()
- (nm_device_set_managed): take a 'reason' argument, and pass it along
to the state change function
* src/nm-manager.c
src/nm-manager.h
- (remove_one_device, handle_unmanaged_devices, sync_devices,
impl_manager_sleep): pass a reason code to nm_device_set_managed()
- (nm_manager_deactivate_connection): add a 'reason' argument and pass
something reasonable along to VPN deactivation
* src/vpn-manager/nm-vpn-manager.c
src/vpn-manager/nm-vpn-manager.h
- (nm_vpn_manager_deactivate_connection): add a 'reason' argument and
pass that along to nm_vpn_connection_disconnect()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4174 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Add support for VPN subnet gateways (bgo #549196)
* include/NetworkManager.h
- Add key for internal VPN subnet gateway
* src/vpn-manager/nm-vpn-connection.c
- (ip_address_to_string): return a const from a static buffer so we
don't leak a lot of strings
- (print_vpn_config): print internal VPN gateway as well
- (nm_vpn_connection_ip4_config_get): grab internal VPN gateway from
VPN service too
- (nm_vpn_connection_get_ip4_internal_gateway): new function
* src/NetworkManagerSystem.c
src/NetworkManagerSystem.h
- (nm_system_device_replace_default_ip4_route): split into two, one for
VPN connections and one for normal devices
- (replace_default_ip4_route): break out route stuff into its own function
- (nm_system_replace_default_ip4_route_vpn,
nm_system_replace_default_ip4_route): simplify by having two cases,
one for VPNs and one for normal devices
* src/NetworkManagerPolicy.c
- (update_routing_and_dns): simplify, use split default route replacement
functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4169 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Rework default route handling to consolidate decisions in the policy,
and to take active VPN connections into account when changing the default
route (bgo #545912)
* src/NetworkManager.c
- (main): pass the vpn_manager to the policy so it knows about active
VPN connections; clean up the named manager which wasn't done before
* src/NetworkManagerPolicy.c
src/NetworkManagerPolicy.h
- (nm_policy_new): get a clue about the vpn_manager
- (update_default_route): remove, fold into update_routing_and_dns()
- (update_routing_and_dns): handle active VPN connections too; an
active VPN connection becomes the default route if it does not have
server-specified or user-specified custom routes. Otherwise, the
best active device gets the default route
- (vpn_connection_activated, vpn_connection_deactivated, nm_policy_new,
nm_policy_destroy): track VPN connection activation and deactivation
and update the default route when appropriate
* src/NetworkManagerSystem.c
src/NetworkManagerSystem.h
- (nm_system_vpn_device_unset_from_ip4_config): remove, put functionality
in the VPN connection itself
- (nm_system_vpn_device_set_from_ip4_config,
nm_system_device_set_from_ip4_config): merge together to make
nm_system_apply_ip4_config()
- (add_vpn_gateway_route): add a route to the VPN's external gateway
via the parent device
- (nm_system_apply_ip4_config): simplify
- (add_ip4_route_to_gateway): new function; add a direct route to the
gateway if needed
- (nm_system_device_replace_default_ip4_route): simplify, break gateway
route stuff out into add_ip4_route_to_gateway() for clarity
* src/nm-device.c
- (nm_device_set_ip4_config): update for nm_system_apply_ip4_config()
* src/vpn-manager/nm-vpn-connection.c
src/vpn-manager/nm-vpn-connection.h
- (nm_vpn_connection_get_ip4_config, nm_vpn_connection_get_ip_iface,
nm_vpn_connection_get_parent_device): add
- (nm_vpn_connection_ip4_config_get): make the requirement of a tunnel
device explicit
- (connection_state_changed): update the named manager now that
nm_system_vpn_device_unset_from_ip4_config() is gone; do something
useful on errors
* src/vpn-manager/nm-vpn-manager.c
src/vpn-manager/nm-vpn-manager.h
- Add a 'connection-activated' signal
- (nm_vpn_manager_get_active_connections): new function; mainly for the
policy to find out about active VPN connections
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4167 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-logging.c (nm_logging_setup): Don't use LOG_CONS when running as
a daemon to prevent NM logging spew on console on startup and shutdown (due
to dependency loop between NM and syslog).
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4166 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Implement managed mode. We bind devices configured in /etc/network/interfaces
to their connections by updating wired/wireless setting with the
mac address of the device.
* system-settings/plugins/ifupdown/plugin.c
- (get_net_address_for_udi): implement function to retrieve MAC
address of udi from hal in GByteArray format
- (bind_device_to_connection): bind mac address of device to
wired/wireless system connection
- (hal_device_added_cb): call bind_device_to_connection for
system connections with a matching interface.name
- (hal_device_added_cb): ensure that all code paths
properly free the "iface" string.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4165 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Parse nm-system-settings.conf and allow admins to either use managed and unmanaged
mode of the ifupdown system config plugin.
* system-settings/plugins/ifupdown/plugin.c
- (SCPluginIfupdown_init): parse nm-system-settings.conf keyfile and set
private unmanage_well_known state field accordingly
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4164 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Implement unmanaged mode that will prevent all devices in the
well_known_udis set from being touched by NetworkManager
* system-settings/plugins/ifupdown/plugin.c
- (typedef struct SCPluginIfupdownPrivate): add gboolean
unmanage_well_known field used to turn on/off unmanaged
mode
- (hal_device_added_cb,hal_device_remove_cb): emit |unmanaged-devices-changed|
signal when well_known_udis get added/removed
- (SCPluginIfupdown_get_unmanaged_devices): return all well_known_udis
if we are in unmanaged mode
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4163 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Add support to track network devices that have a configuration
with a matching interface.name in /etc/network/interfaces
* system-settings/plugins/ifupdown/plugin.c
- (typedef struct SCPluginIfupdownPrivate): add hash table
to track |well_known_udis|
- (get_iface_for_udi): helper function to get interface.name
for a udi
- (hal_device_added_cb, hal_device_removed_cb): callbacks
that add and remove devices to and from the well_known_udis
set depending on whether their |interface.name| matches
any interface definition in /etc/network/interfaces
- (SCPluginIfupdown_init): connect callbacks from above with
hal_mgr and setup well_known_udis hashtable
- (GObject__dispose): destroy well_known_udis hashtable
- (hal_device_added_cb2): implement wrapper callback with GFunc
signature. user_data is supposed to be a triple (hal_mgr,
config and devtype)
- (SCPluginIfupdown_init): bootstrap wired and wifi devices for
startup and call hal_device_added_cb2
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4162 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManagerSystem.c
- (find_route): ref the route so it doesn't get destroyed when the cache
is cleared
- (nm_system_device_set_priority): unref the route here after it's done
being used
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4156 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* system-settings/plugins/keyfile/nm-keyfile-connection.c (update): Update the
connection with new settings before saving it.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4154 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-ip4-config.c
src/nm-ip4-config.h
- nm_ip4_config_is_exported -> nm_ip4_config_get_dbus_path
* src/nm-device-interface.c
- (nm_device_interface_init): make 'ip4-config' a boxed property of type
DBUS_TYPE_G_OBJECT_PATH so that we can make it NULL when we need to
by using '/' for the object path
* src/nm-device.c
- (src/nm-device.c): marshal missing/unexported ip4-config through
dbus as '/' since dbus-glib can't handle NULL objects nor can
dbus handle NULL object paths
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4152 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* system-settings/plugins/ifcfg-fedora/nm-inotify-helper.c
system-settings/plugins/ifcfg-fedora/nm-inotify-helper.h
system-settings/plugins/ifcfg-fedora/Makefile.am
system-settings/src/nm-inotify-helper.c
system-settings/src/nm-inotify-helper.h
src/Makefile.am
- Move ifcfg-fedora inotify helpers to the system settings service so
they are available to all plugins
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4150 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Implement support for wep-tx-keyidx in ifupdown system
config plugin.
* system-settings/plugins/ifupdown/parser.c
- (update_wireless_security_setting_from_if_block): introduce
free_type_mapping func table; rename a few local
variables to improve readability; add wpa security mapping
for wep-tx-keyidx property
- (string_to_gpointerint): new function used for the auto_type_mapping
of new wep-tx-keyidx property
- (slist_free_all): free func used for mapped slist types
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4148 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* system-settings/src/main.c:
- (add_default_dhcp_connection, device_removed_cb): ensure the UDI is
always used as the hash key; fixes a crash when removing wired
devices
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4147 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-gsm-device.c
- (enter_pin_done, enter_pin, check_pin_done, real_act_stage1_prepare):
pass the required GSM secret along via user_data rather than keeping
it around in the private data where it sometimes didn't get cleared
- (real_get_ppp_name): implement using the GSM username
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4142 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 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
Patch from Alexander Sack <asac ubuntu com>
* system-settings/plugins/ifupdown/parser.c
- Implement more graceful ip4 config parsing for cases where
/etc/network/interfaces omits basic ip4 settings, such as gateway etc
by using default values
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4139 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManagerPolicy.c
- (device_state_changed): when marking a connection invalid, clear its
secrets too so that fresh secrets get requested the next time
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4138 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* system-settings/src/dbus-settings.c
- (nm_sysconfig_settings_init): cache system hostname on startup as
a fallback if no plugin provides a hostname
- (get_property): fall back to cached hostname if no plugin provides
a hostname
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4136 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Fix setting value comparison issue that caused some settings to look the
same when they were really different (rh #464417)
* libnm-util/nm-param-spec-specialized.c
- (type_is_fixed_size): return fundamental size of the fixed type too
- (nm_gvalues_compare_collection): use the fundamental fixed type size
in the comparison so that the _entire_ fixed type collection gets
compared rather than just the first 'len1' bytes
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4134 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManagerPolicy.c
- (lookup_thread_worker): don't store the idle handler ID becuase the
idle handler could have already run and freed the LookupThread
structure
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4126 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-device.c (nm_device_get_priority): Implement.
(nm_device_set_ip4_config): Send the device priority to system ip4
config setter.
* src/NetworkManagerSystem.c (nm_system_device_set_from_ip4_config):
Add priority argument and if it's >= 0, set the priority of the network
route added automatically by netlink (or kernel?).
(nm_system_device_set_priority): Implement.
* src/NetworkManagerPolicy.c (get_best_device): Use
nm_device_get_priority() instead of home-grown version. Revert the
meaning, best priority is the lowest one.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4125 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Handle ipw3945 suspend/resume by retrying the GIWRANGE request a few times
when it returns EAGAIN (rh #362421)
* src/nm-device-wifi.c
- (wireless_get_range): try GIWRANGE a few times until the card responds
- (real_get_generic_capabilities, constructor): use wireless_get_range()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4120 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-serial-device.c
src/nm-serial-device.h
- (nm_serial_device_close): stop PPP manager here so that PPP gets
cleaned at the right times when subclasses close the serial port too
- (nm_serial_device_send_command): use a default send delay; don't
spin forever on EAGAIN
- (get_reply_done, get_reply_got_data, nm_serial_device_get_reply):
remove, no longer used
- (find_response): return the matched response if any
- (nm_serial_device_wait_reply_blocking): wait for a reply but block
while doing so
- (wait_for_reply_done): pass the matched response to the callback
- (wait_for_reply_got_data): save the matched response; simplify timeout
handling
- (nm_serial_device_wait_for_reply): make 'responses' and 'terminators'
const since they never get modified
- (cleanup_device): split out common cleanup stuff to a new function
- (real_deactivate_quickly, finalize): use cleanup_device()
* src/nm-gsm-device.c
- (modem_get_reply): remove, unused
- (set_apn): give the card a bit more time to respond
- (manual_registration_again, schedule_manual_registration_again,
manual_registration_response, manual_registration): handle manual
registration timeouts better by retrying registration a few times
because cards are a bit slow after CFUN=1
- (automatic_registration_get_network, get_network_response): use
modem_wait_for_reply() because it interacts better with the serial
buffer and does more intelligent matching; need to wait for 'OK'
rather than just matching terminators
- (schedule_automatic_registration_again,
automatic_registration_response, automatic_registration): retry
registration a few times on timeout or "searching" because cards
take a bit to find a network after being powered up with CFUN=1
- (power_up_response, power_up, init_full_done, enter_pin,
check_pin_done): power up the card with CFUN=1 before trying to
register with the network
- (init_modem_full, init_modem): use more standard 3G init strings
* src/nm-hso-gsm-device.c
- (modem_get_reply): remove, unused
- (hso_ip4_config_response, real_act_stage3_ip_config_start): use
modem_wait_for_reply() to match actual responses instead of single
termination characters; it doesn't leave stuff in the serial buffer
that might confuse later calls
- (real_deactivate_quickly): use nm_serial_device_wait_reply_blocking()
to ensure that the call is really disconnected and not leave extra
stuff in the serial buffer
* src/nm-cdma-device.c
- (power_up_response, power_up, init_done): try Sierra-style modem
power up before attempting to connect
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4119 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
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
* src/supplicant-manager/nm-supplicant-interface.c
(nm_supplicant_interface_disconnect): Don't increment the reference
count when disconnecting. The problem is on shutdown, when the replies
to these commands do not arrive before NM exits, resulting on never
calling supplicant interface's dispose(), which removes the interface
from supplicant.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4093 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/vpn-manager/nm-vpn-connection.c: Add a signal handler for the
"Failure" signal from VPN plugins, store the failure reason, and
use it when the state is changed to failure.
* introspection/nm-vpn-plugin.xml: Fix the "Failure" signal's type
description.
* include/NetworkManagerVPN.h (NMVPNConnectionStateReason): Add a new
reason to the end of the list to not break the API.
(NMVPNPluginFailure): Move it here (from libnm-glib/nm-vpn-plugin.h)
so it can be shared by plugins and daemon.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4088 4912f4e0-d625-0410-9fb7-b9a5a253dbdc