Commit Graph

8762 Commits

Author SHA1 Message Date
Pavel Šimerda
f548a49782 trivial: clarify has_ip_config()
Make it more explicit that it returns TRUE for UNMANAGED state.
2013-07-02 20:12:54 +02:00
Pavel Šimerda
46abdf254c core: convey route priority to nm-platform 2013-07-02 19:35:55 +02:00
Pavel Šimerda
9e3f18f0ba trivial: remove redundant include 2013-07-02 19:34:16 +02:00
Jiří Klimeš
5e9ab28c5a core: call nm_device_queue_state() instead of direct state transition
in nm_device_start_ip_check(), because it is called from the state handler
(nm_device_state_changed()).

Errors:
(devices/nm-device.c:5585):nm_device_state_changed: runtime check failed: (priv->in_state_changed == FALSE)
<info> (eth0): device state change: ip-check -> secondaries (reason 'none') [80 90 0]
2013-07-02 15:36:46 +02:00
Jiří Klimeš
c8d5f73218 libnm-util: fix description comment for 'read-only' property 2013-07-01 17:52:25 +02:00
Jiří Klimeš
44b6a441b9 libnm-util: update 'timestamp' property description, noting it is read-only 2013-07-01 17:07:24 +02:00
Jiří Klimeš
a6f28f402b core: set GError on failure in nm_manager_deactivate_connection() (rh #976627)
It fixes NM crash (abort) when VPN connection can't be disconnected.
2013-07-01 10:18:41 +02:00
Pavel Šimerda
0652d9c596 core: use ip[46]_state for IP configuration status
Don't assume that NULL ip[46]_config means anything specific.
2013-06-27 18:33:18 +02:00
Jiří Klimeš
3fc604ca79 keyfile: do not set GError over the top of a previous GError 2013-06-27 18:29:26 +02:00
Pavel Šimerda
47c5e61515 policy: use nm_ip[46]_config_get_gateway() 2013-06-27 16:25:20 +02:00
Pavel Šimerda
7218b8d069 core: always commit DHCPv4 config
DHCPv4 config can change even during connection assumption.
2013-06-27 16:14:33 +02:00
Jiří Klimeš
941ab71279 dbus: fix dbus_connection_changed_cb() definition to take DBusConnection
dbus_connection_changed_cb() is called by DBUS_CONNECTION_CHANGED signal
that emits DBusConnection, not DBusGConnection.

The code was introduced by bd636ffb4068a75b204d99e798b5714f1bd5f24b; see it
for more information.

Reproducer: restart D-Bus daemon

 (gdb) bt
 #0  0xb7d40837 in pthread_mutex_lock () from /lib/libpthread.so.0
 #1  0xb7cf946c in _dbus_platform_rmutex_lock () from /lib/libdbus-1.so.3
 #2  0xb7ceba78 in _dbus_rmutex_lock () from /lib/libdbus-1.so.3
 #3  0xb7cd5f2e in dbus_connection_add_filter () from /lib/libdbus-1.so.3
 #4  0x080c40b5 in dbus_connection_changed_cb (dbus_mgr=0x8161b28, connection=0x81badc0, user_data=0x8189010)
     at nm-manager.c:4499
 #5  0xb7a6bfaa in g_cclosure_marshal_VOID__POINTER () from /lib/libgobject-2.0.so.0
 #6  0xb7a69007 in g_closure_invoke () from /lib/libgobject-2.0.so.0
 #7  0xb7a7afad in signal_emit_unlocked_R () from /lib/libgobject-2.0.so.0
 #8  0xb7a83261 in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
 #9  0xb7a833e4 in g_signal_emit () from /lib/libgobject-2.0.so.0
 #10 0x080b4136 in nm_dbus_manager_reconnect (user_data=0x8161b28) at nm-dbus-manager.c:568
 #11 0xb7969e50 in g_timeout_dispatch () from /lib/libglib-2.0.so.0
 #12 0xb796915b in g_main_context_dispatch () from /lib/libglib-2.0.so.0
 #13 0xb7969500 in g_main_context_iterate.isra.22 () from /lib/libglib-2.0.so.0
 #14 0xb7969963 in g_main_loop_run () from /lib/libglib-2.0.so.0
 #15 0x08065e67 in main (argc=1, argv=0xbffff814) at main.c:629
2013-06-27 12:56:17 +02:00
Jiří Klimeš
500fb12c28 ipv6: ignore default routes when creating configuration for generic interface
NM handles the default routes, so they shouldn't show up in the NMIP6Config
for any interface.  They get exposed via the 'default' and 'default6' properties
of the ActiveConnection instead.

The same has been done for IPv4 by c77c566983.
2013-06-27 10:52:39 +02:00
Pavel Šimerda
52dca880cc core: clarify nm_device_set_ip?_config()
The 'assume' parameter was misused for stuff that has nothing to do with
connection assumption. The 'commit' argument with reversed logic is much
clearer.
2013-06-26 23:52:58 +02:00
Pavel Šimerda
b66355e9ef platform: use platform sources even for testing tools
This (together with a patch adding src/platform/Makefile.am) allows for
a workflow where your working directory is src/platform and all tests
and testing tools are rebuilt with your src/platform modifications.
2013-06-26 22:40:48 +02:00
Pavel Šimerda
4134acc614 platform: simplify tests Makefile.am using variables 2013-06-26 22:40:28 +02:00
Pavel Šimerda
b0ae0be291 platform: use the term 'software devices' consistently 2013-06-26 22:38:55 +02:00
Pavel Šimerda
9d92275ac9 platform: add link type classification 2013-06-26 22:29:11 +02:00
Pavel Šimerda
1c078e9bd5 platform: log route metric 2013-06-26 19:58:18 +02:00
Pavel Šimerda
a19e1d6f61 platform: make log_* consistent 2013-06-26 19:58:18 +02:00
Pavel Šimerda
75430c72d0 platform: avoid netlink synchronization problem
The route metric is one of the object's key attributes and therefore
cannot be left to be chosen by the kernel. Instead, it must always be
specified explicitly. This matches the architecture of libnl3 and the
current API provided by nm-platform.
2013-06-26 19:58:18 +02:00
Dan Winship
ec1376fad2 trivial: update .gitignore 2013-06-26 11:10:02 -04:00
Jiří Klimeš
4358f5cc39 cli: fix erroneous messages and asserts for activation bond/bridge connections
error messages in bond_bridge_slaves_check():
** (process:11921): CRITICAL **: nm_device_bond_get_slaves: assertion `NM_IS_DEVICE_BOND (device)' failed
** (process:11921): CRITICAL **: nm_device_get_iface: assertion `NM_IS_DEVICE (device)' failed
2013-06-26 13:45:15 +02:00
Dan Williams
0eb97f3ad5 agents: change secrets request hints back to char **
Previously I didn't think they'd be used for anything other than connection secrets
which only have one hint, but in the future we'll want to pass more information.
2013-06-25 17:43:39 -05:00
Dan Williams
b34fdde19c agents: refactor agent secrets request tracking to be more generic
Split the agent secrets request tracking structure into a generic
structure for tracking any agent request, and a connection-specific
subclass.  We'll use the generic structure in the future for device
secrets and other stuff.
2013-06-25 17:43:39 -05:00
Jiří Klimeš
01585d2ebe keyfile: fix reading bonding options (bgo #701527)
Bonding options are written straight into [bond] group like:
[bond]
interface-name=bbb
mode-active-backup
miimon=300

So we have to handle them explicitly.
2013-06-25 18:03:19 +02:00
Jiří Klimeš
236155d9c9 libnm-util: remove 'downdelay' and 'updelay' when setting 'arp_interval'
Both 'downdelay' and 'updelay' bonding options are only valid with 'miimon'
that is being removed when setting 'arp_interval'.
2013-06-25 18:03:11 +02:00
Jiří Klimeš
128c9d788f libnm-util: verify() - can't set both IPv4 'disabled' and IPv6 'ignore' method 2013-06-25 18:03:02 +02:00
Pavel Šimerda
393346b4fc cleanup: remove unused netlink/system code 2013-06-25 09:55:57 +02:00
Pavel Šimerda
70916c79eb cleanup: remove libnl dependency from nm-ip4-config/nm-ip6-config 2013-06-25 09:53:27 +02:00
Pavel Šimerda
57df4ce5ed core: use nm-platform for route management 2013-06-25 09:52:12 +02:00
Pavel Šimerda
96219b1d86 vpn: use nm-platform for default routes 2013-06-25 09:52:06 +02:00
Pavel Šimerda
91f8de7936 policy: use nm-platform for routing 2013-06-25 09:50:36 +02:00
Pavel Šimerda
48670c0156 core: use nm-platform for address management 2013-06-25 09:50:36 +02:00
Pavel Šimerda
ef73aa3b2c platform: route utility functions 2013-06-25 09:50:35 +02:00
Pavel Šimerda
bd0fd1cd1d platform: address utility functions 2013-06-25 09:32:06 +02:00
Dan Williams
ab8ca2dbe2 core: fix flushing of routes and updating legacy IPv4 address property
We can't clear the ip_iface until after all the routes and addresses
are updated and flushed, because the addresses and routes are
identified by the ip_iface, and if we clear the ip_iface, we don't
know which things to flush anymore.

Example: 'hso' modems have an 'iface' of 'ttyHS4' (a serial port) and
an ip_iface of 'hso0' (an ethernet port).  If we clear the ip_iface too
soon, then ip_iface/ip_ifindex is invalid and thus NM has no idea what
to remove, and the default route pointing to 'hso0' sticks around.

This could also happen with other devices where the ip_iface is
different than the iface, like modems, ADSL/ATM devices, etc.
2013-06-24 22:47:57 -05:00
Colin Walters
c70ffd6f9b config: Include overrides in parsed config file message
Useful to see which files are being read.
2013-06-24 15:48:53 -05:00
Colin Walters
2269b708ac main+logging: Allow early logging before config files
The new setup phase goes like this:

- main()
- parse command line options
- logging is configured, targeting stdout/stderr
- ...other stuff...
- do or do not daemonize, depending on commandline option and config files
- Call openlog() - further log messages go to syslog (and potentially
  stderr as well, if the -d option was specified so we use LOG_PERROR).

Basically, this allows us to log messages about config file parsing
and such, which *greatly* helps with debugging.
2013-06-24 15:48:53 -05:00
Colin Walters
8043d77237 main: Move static assertions after setlocale(), but before option processing
These assertions (such as getuid() == 0) don't need to access the
config files or commandline arguments, but *do* output localized error
messages, so they should be after setlocale().
2013-06-24 12:25:49 -04:00
Colin Walters
d3fd1b7464 main: Set umask earlier
Since we may be creating e.g. pid files before this, we need to set
the umask as early as possible.
2013-06-24 12:25:49 -04:00
Colin Walters
4ff7eeeaae main: setenv(GIO_USE_VFS=local) *very* early
See https://bugzilla.gnome.org/show_bug.cgi?id=701322 for why we
should order calls to setenv() as early as possible.
2013-06-24 12:25:49 -04:00
Jiří Klimeš
12955fcda6 dispatcher: fix tests after ac536c2124
We need to use G_TYPE_STRV instead of DBUS_TYPE_G_ARRAY_OF_STRING, because
G_TYPE_STRV will be the type that will come to the dispatcher over D-Bus.
2013-06-24 13:57:52 +02:00
Jiří Klimeš
71b5b77b3a libnm-util: add Since tag to interface-name property 2013-06-24 12:39:01 +02:00
Jiří Klimeš
5d1a6813d0 cli: print newly added 'gateway-ping-timeout' connection's property 2013-06-24 12:25:12 +02:00
Jiří Klimeš
2cc42bad06 libnm-util: fix tests after 'gateway-ping-timeout' addition 2013-06-24 12:24:17 +02:00
Tomas Hozza
ac536c2124 dispatcher: expose domains in IP4/6 config
Previously the function add_domains() expected the
"domains" value to be of type DBUS_TYPE_G_ARRAY_OF_STRING
but the value is in fact of type G_TYPE_STRV. Also
added check to log critical message in case of "val"
not holding G_TYPE_STRV type.

This caused dispatcher not to export IPx_DOMAINS
environment variable.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2013-06-21 16:27:23 -05:00
Dan Williams
8ce4250d8e core: ping the gateway during the IP_CHECK state (bgo #702515)
Using the new gateway-ping-timeout property, send pings to the first
gateway address until it replies or the timeout is reached, to deal
with dumb hardware that indicates carrier on but doesn't actually
pass traffic.

https://bugzilla.gnome.org/show_bug.cgi?id=702515
2013-06-21 16:18:49 -05:00
Dan Williams
00203a8798 libnm-util: add gateway-ping-timeout property to connection setting
To better handle broken hardware, like switches which don't pass
traffic for a few seconds after a carrier has been negotiated,
add a timeout to control how long to wait for successful pings
of the gateway before giving up and proceeding with IP config.
Default is 0, which means don't ping the gateway, just assume
the NIC/switch aren't lying and can pass traffic immediately.
2013-06-21 16:17:18 -05:00
Dan Williams
e1bb469f80 api: update SecretAgent API with allowed errors for GetSecrets reply 2013-06-21 16:06:44 -05:00