Commit Graph

4279 Commits

Author SHA1 Message Date
Pavel Šimerda
21a8a71d48 rdisc: abstract class and fake implementation
Abstract class, fake implementation and a manual testing tool for
NetworkManager's internal IPv6 router discovery module. When a real
implementation is ready, it will replace nm-ip6-manager and will be used
by nm-device.
2013-07-20 16:50:18 +02:00
Pavel Šimerda
74d8d374b3 trivial: remove unnecessary check
inet_ntop doesn't even have enough information to add the percent sign
and the device name.
2013-07-20 16:50:17 +02:00
Pavel Šimerda
f7b2443035 core: always commit ip[46]-config to nm-platform
This is necessary to update the address lifetimes.
2013-07-20 15:30:09 +02:00
Pavel Šimerda
d8e6065f63 core: switch nm-ip4-config's NMIP[46]Address to NMPlatformIP[46]Address 2013-07-20 15:30:08 +02:00
Pavel Šimerda
74621a8f5c core: replace nm_ip[46]_config_diff()
Callers of these functions now only care whether two IP configs are
different and not what specific property changed, so we can simplify
this code down to a simple comparison for equality, based on the hashing
that's already done for the DNS manager.
2013-07-20 15:30:08 +02:00
Pavel Šimerda
a291448cf4 policy: don't use nm_ip[46]_config_diff()
nm-platform will cope with unnecessary configuration commits.
2013-07-20 15:30:08 +02:00
Dan Williams
c370c04fee core: fix trailing semicolon that caused all IP6 configs never to get applied 2013-07-15 17:10:45 -05:00
Pavel Šimerda
d42f99f590 device: clean up ip6 configuration flow
IP6 configuration is now stored in ac_ip6_config and dhcp6_ip6_config
and passing them as function arguments is avoided. Written with Dan
Williams.
2013-07-15 15:53:43 +02:00
Dan Williams
d687492d49 ifcfg-rh: add support for gateway ping timeout 2013-07-12 22:32:06 -05:00
Dan Williams
7c2abb2c9f core: fix stray semicolon causing VPN routes to not be added 2013-07-12 14:09:05 -05:00
Pavel Šimerda
317bd6bf6c trivial: check for NULL setting in nm_ip6_config_merge_setting() 2013-07-12 18:45:52 +02:00
Pavel Šimerda
7c0657a119 core: cleanup nm-ip[46]-config 2013-07-12 11:38:35 +02:00
Pavel Šimerda
19747082b2 trivial: remove unused tried_ipv6 2013-07-09 12:29:47 +02:00
Pavel Šimerda
fca1c0d88f trivial: move vpn/bonding functions out of nm-system
As nm-system only contained auxiliary functions which fit in their
respective modules better, it can be safely removed.
2013-07-05 17:27:15 +02:00
Pavel Šimerda
019dd1b7d8 trivial: remove unused system.h includesl 2013-07-05 17:22:34 +02:00
Pavel Šimerda
becbf1a84c core: enable libgsystem
Got build problems with some of the pavlix/runtime patches without that.
2013-07-05 00:58:56 +02:00
Pavel Šimerda
7dcec4d100 trivial: move back nm_match_spec_string()
Was moved by accident.
2013-07-04 20:20:27 +02:00
Pavel Šimerda
c1538496a9 trivial: simplify nm_ip[46]_config_diff() NULL comparison logic 2013-07-04 18:15:30 +02:00
Pavel Šimerda
253906ecd2 trivial: simplify nm_ip[46]_config_diff() result check
nm_ip[46]_config_diff() explicitly checks for NULL arguments.
2013-07-04 18:15:08 +02:00
Pavel Šimerda
3e534c0e65 dhcp: use nm_ip[46]_config_get_gateway() in tests 2013-07-04 17:45:49 +02:00
Pavel Šimerda
8de1b1732e trivial: move merge_ip6_configs() to nm-ip6-config 2013-07-04 13:37:26 +02:00
Pavel Šimerda
6cdc16d147 core: use nm_ip[46]_config_get_gateway() 2013-07-04 13:22:46 +02:00
Pavel Šimerda
7967a6524a trivial: move a couple of functions to nm-ip[46]-config
Note that this patch doesn't effectively change any code.

Functions moved from nm-system:

* nm_system_apply_ip?_config → nm_ip?_config_commit
* ip?_dest_in_same_subnet → nm_ip?_config_destination_is_direct

Functions moved from NetworkManagerUtils:

* nm_utils_merge_ip?_config → nm_ip?_config_merge_setting

Functions renamed (and moved down to form one group):

* nm_ip?_config_new_for_interface → nm_ip?_config_capture

(The rationale for the rename is that from the achitectural point of
view it doesn't matter whether the function creates a new object or
updates an existing one. After the rename, it's obvious that
nm_ip?_config_capture() and nm_ip?_config_commit() are counterparts of
each other.)
2013-07-03 16:12:23 +02:00
Jiří Klimeš
e2b7c4824d core: fix IP_DONE vs. IP_FAIL states
0652d9c596 changed IP states like this:
        |        old behaviour          |  new behaviour
---------------------------------------------------------
success | IP_DONE && config is not NULL |    IP_DONE
failure | IP_DONE && config is NULL     |    IP_FAIL

But some failure paths was not updated.
2013-07-03 10:48:14 +02:00
Pavel Šimerda
ca6b360089 core: don't use flags for nm_system_apply_ip[46]_config
nm_platform_*_sync() functions check the cached kernel configuration
items (addresses, routes) before adding addresses to the kernel.
Therefore we don't need to be so careful about pushing NetworkManager
configuration to the kernel.

This patch helps to avoid having to compare nm_ip[46]_config objects,
which should only be created when a configuration change is being
performed.
2013-07-02 22:49:56 +02:00
Pavel Šimerda
7a7d171d6a trivial: remove obsolete FIXME 2013-07-02 21:16:22 +02:00
Pavel Šimerda
ed9065c978 vpn: don't misuse parent's prefix length
The VPN gateway is a single address.
2013-07-02 20:51:53 +02:00
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š
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
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