Commit Graph

8762 Commits

Author SHA1 Message Date
Pavel Šimerda
c936f61a43 updated libgsystem 2013-08-03 00:34:59 +02:00
Dan Williams
873df63e78 core: add nm_ip4_config_dump() 2013-08-02 17:19:36 -05:00
Dan Williams
0aada347c1 core: recognize and handle external IPv4 routes and addresses added under NM
Don't blow them away on DHCP/VPN/IP changes.
2013-08-02 17:19:36 -05:00
Dan Williams
455df69f02 core: fix handling of externally added IPv4 adresses and routes on IP change
The switch to combine IPv4 configs to arrive at the final config would
cause externally added addresses and routes to be removed from the
interface when a DHCP or LLv4 event came in, becasue the externally
added details weren't cached anywhere and thus would be dropped on the
IP changes.
2013-08-02 17:19:36 -05:00
Dan Williams
7e21b528a9 core: add nm_ip4_config_subtract()
Removes anything in 'src' from 'dst'.
2013-08-02 17:19:36 -05:00
Dan Williams
5c1ec7cedf core: track VPN routes on the master device, not the VPN
When a VPN wanted to add some routes (like the host route for the
VPN gateway) it would add them itself and listen for parent device
events and re-add them if necessary.  That's pretty fragile, plus
the platform blows away routes that aren't part of the IP config
that's getting applied.

So we might as well just have the VPN connection tell the parent
what the routes are, and have the parent device handle updating
the routing.  The routes are through the parent device anyway,
and so are "owned" by the parent too.
2013-08-02 17:19:35 -05:00
Dan Williams
468243baf2 core: combine and apply IPv4 configs instead of applying directly
Like IPv6, keep the DHCP/LLv4 config separate and combine it with the
NMSettingIP4Config to arrive at the final, combined IP4 config.  This
brings the behavior in line with IPv6 code flow and will allow adding
the VPN routes config into the mix more easily.
2013-08-02 17:19:35 -05:00
Dan Williams
1923f54d79 build: fix distcheck
New platform changes need NMPlatformReason enum which requires the
generated nm-enum-types.h, which is only in the builddir.
2013-08-02 17:09:50 -05:00
Pavel Šimerda
356cad68fa platform: add reason attribute to all signals 2013-08-02 23:12:21 +02:00
Pavel Šimerda
c1bbacae4c platform: re-check potentially removed objects 2013-08-02 23:04:46 +02:00
Pavel Šimerda
d85ae74388 platform: rework the object refresh code 2013-08-02 22:17:07 +02:00
Pavel Šimerda
900b4b15c5 platform: don't check for route existence (fixup)
This was part of a patch that resulted in commit 5dd15bd but
unfortunately also part of a reverted patch 42b4323. We need
to add it back.
2013-08-02 22:17:07 +02:00
Pavel Šimerda
2167e4376b Revert "platform: work around missing kernel netlink notifications of default route changes"
This reverts commit 42b4323902.
2013-08-02 22:17:06 +02:00
Dan Winship
f9016e203a ifcfg-rh: update InfiniBand P_Key support to match latest initscripts 2013-08-02 13:54:13 -04:00
Pavel Šimerda
29d88b3b59 updated libndp 2013-08-02 15:39:51 +02:00
Pavel Šimerda
5dd15bd459 platform: don't check for route existence
This is the same we already did for nm-platform addresses in commit
68c3e1153c. It will help to avoid various
issues and is also a step towards support for route lifetimes.
2013-08-01 18:09:03 +02:00
Dan Williams
42b4323902 platform: work around missing kernel netlink notifications of default route changes
It appears the kernel does not send notifications via netlink if the
default route is removed in some cases.  This causes the platform
route cache to become stale, and thus when the default route is
reset by NM the platform thinks the route already exists, and does
not add it.  But the route doesn't exist, becuase the kernel silently
removed it without telling anyone.

Fix that with a big hammer by flushing/refilling the route cache when
devices are deactivated (deletion of their addresses causes the default
route to be removed by the kernel) and when the default route is
updated by NM itself.

Pavel: if we find a more granular method, we should probably revert
this as the cache refill can be expensive.
2013-07-31 12:14:52 -05:00
Dan Williams
802d4cdad2 agents: don't make method calls with a destroyed proxy
If the agent has dropped off the bus then its proxy may already
be destroyed, so we'll get warnings when trying to make method
calls using it.  Track proxy destruction and warn if we try to
use a destroyed proxy.
2013-07-31 08:16:41 -05:00
Dan Williams
724b9c045b agents: remove request_cancel()
Turns out this function is useless, because it's only called when the
agent has dropped off the bus or when the whole request is being
freed.  If the agent has dropped off the bus then there's no point
in asking it to cancel the request because there's nothing to ask.
So we can collapse request_cancel() into request_free().
2013-07-31 08:16:41 -05:00
Dan Williams
ab84a86678 vpn: handle interactive plugin secrets requests
If all agents can handle VPN hints, then we'll try to use
ConnectInteractive() to let the VPN plugin ask for secrets
interactively via the SecretsRequired signal.  These hints
are then passed to agents during the connection process if
the plugin needs more secrets or different secrets, and when
the new secrets are returned, they are passed back to the VPN
plugin.

If at least one agent does not have the VPN hints capability,
we can't use ConnectInteractive(), but fall back to the old
Connect call, because that agent won't be able to send the
hints to the VPN plugin's authentication dialog, and thus
we won't get back the secrets the VPN plugin is looking for.

So, for interactive secrets to work correctly, you need:

1) A VPN plugin updated for interactive secrets requests
2) NM updated for interactive secrets requests
3) all agents to set the VPN_HINTS capability when
    registering with NetworkManager and to pass hints
    along to the VPN authentication dialog
4) a VPN authentication dialog updated to look for hints
    and only return secrets corresponding to the hints
    requested by the plugin
2013-07-31 08:16:40 -05:00
Dan Williams
cc924d8bab libnm-glib-vpn: add support for interactive secrets requests
There are three additions to the D-Bus interface for VPN plugins as
part of this patch:

1) ConnectInteractive(): called by NM instead of Connect() to let
the plugin know that it can request additional secrets during the
connection process using SecretsRequired

2) SecretsRequired: a new signal emitted by the plugin to indicate
to NetworkManager that additional secrets are required to connect;
can only be called if NetworkManager initiated the connection by
calling the ConnectInteractive() method

3) NewSecrets(): a new method of the plugin that NetworkManager calls
when new secrets requested by the SecretsRequired signal have been
retrieved from secret agents

We need new methods because agents need to be aware of the hints that
the VPN plugins may send with the SecretsRequired signal (detailing
the specific secrets that are required) and at this time, not all
agents support passing those hints to the VPN plugin authentication
dialogs.
2013-07-31 08:16:40 -05:00
Dan Williams
eacd4cf8f9 libnm-glib-vpn: consolidate connect handling code 2013-07-31 08:16:40 -05:00
Dan Williams
e7dbe20526 libnm-glib: add support for agent capabilities during registration
Tries the new RegisterWithCapabilities method first, and falls back
to the old Register method for compatibility with older NetworkManager.
2013-07-31 08:16:40 -05:00
Dan Williams
16bb798861 agents: add agent capabilities
A new agent registration method enables agents to pass capabilities during
the registration process.
2013-07-31 08:16:34 -05:00
Dan Winship
cfa4117ebb autogen.sh: pass --enable-static=libndp
jhbuild (in the suggested configuration) passes --disable-static, but
we need static libndp at least. So tweak autogen.sh to ensure that
happens.
2013-07-30 13:16:16 -04:00
Pavel Šimerda
e0f37dce45 dhcp: fix IPv6 address timestamp setting 2013-07-30 16:36:47 +02:00
Pavel Šimerda
e59949c7cf platform: show address lifetimes in debug 2013-07-30 16:36:47 +02:00
Jiří Klimeš
de42b9be67 cli: editor: show current configuration for 'nmcli' command without arguments 2013-07-30 14:04:59 +02:00
Jiří Klimeš
18817877ad cli: confirm connection saving when autoconnect=yes (rh #953296)
Ask for confirmation in these cases:
* autoconnect=yes and connection has not been saved yet
* autoconnect=yes, but saved connection had autoconnect=no

The confirmation can be switched off with
nmcli> nmcli save-confirmation no
2013-07-30 14:04:52 +02:00
Jiří Klimeš
6f633a678a cli: editor: automagic changes of IP 'addresses'/'method' if the other is set 2013-07-30 14:04:47 +02:00
Jiří Klimeš
379951ee18 platform-test: fix build with glib < 2.34
Use our compatibility version for g_clear_pointer() that is not defined
in glib < 2.34.
2013-07-30 12:53:42 +02:00
Jiří Klimeš
4aa56de14c build: only add 'serial-tests' for automake >= 1.12
Earlier versions of automake complain if they get a configuration
parameter which they don't understand.  The error is:

configure.ac:19: option `serial-tests' not recognized

Use some m4 hackery to work around this.

Stolen from here by jklimes:
https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html
2013-07-30 12:53:42 +02:00
Pavel Šimerda
b502b6cd58 platform: ignore kernel-generated routes
This is necessary to avoid tinkering with IPv4 prefix routes
automatically inserted by the kernel for each IPv4 address.

https://bugzilla.gnome.org/show_bug.cgi?id=705102
2013-07-30 11:40:19 +02:00
Pavel Šimerda
68c3e1153c platform: update all address lifetimes
The nm_platform_ip[46]_address_sync() functions no longer use
nm_platform_ip[46]_address_exists() to avoid adding already
existing addresses. That means nm_platform_ip[46]_address_add()
is now called for *all* commited addresses and the lifetimes
are thus always updated.

Because of that, nm_platform_ip[46]_address_add() had to be modified to
accept existing addresses and update their lifetimes when appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=705102
2013-07-30 11:40:19 +02:00
Pavel Šimerda
3cf1b71de2 platform: simplify address comparisons 2013-07-30 11:40:19 +02:00
Pavel Šimerda
22c4f5f5af platform: handle empty arrays in array_contains_ip[46]_*() 2013-07-30 11:40:19 +02:00
Pavel Šimerda
53e55aab36 dhcp: push address lifetime to nm-ip[46]-config 2013-07-30 11:40:19 +02:00
Pavel Šimerda
a560148d27 core: use address lifetimes from router discovery 2013-07-30 11:40:19 +02:00
Pavel Šimerda
da71cc6e8c trivial: allow building tests from rdisc directory
The nm-rdisc subsystem, just as the nm-platform subsystem is separately
testable and it proved convenient to be able to build the test programs
by just typing 'make' in the rdisc/platform directory where the source
code for those modules resides.
2013-07-30 11:40:18 +02:00
Pavel Šimerda
f6ef374076 trivial: use 'preferred' attribute name for preferred lifetime 2013-07-30 11:40:18 +02:00
Pavel Šimerda
439473e9a4 valgrind: print absolute path
Relative paths in makefiles have different anchor than the current shell
directory.
2013-07-30 11:39:28 +02:00
Dan Williams
9fea2430bd platform: temporarily work around mismatching lifetime/timestamp/preferred (bgo #705102)
Addresses in the platform cache will have timestamp/lifetime/preferred set,
but addresses to be added or removed (like new IP config from DHCP renewal
or new RAs) won't have these set, since they only get set when the address
is actually added to the kernel.  So when syncing addresses, we can't look
at any of these items or nothing matches, and all existing addresses get
removed.

https://bugzilla.gnome.org/show_bug.cgi?id=705102
2013-07-29 14:54:25 -05:00
Pavel Šimerda
0e361e894c core: turn link_changed() into a proper virtual function 2013-07-29 13:51:13 +02:00
Dan Williams
5767af2601 core: use NM_PLATFORM_LIFETIME_PERMANENT instead of G_MAXUINT32 2013-07-28 08:28:37 -05:00
Pavel Šimerda
5216cd4eb3 core: detect automatic addresses when assuming connections 2013-07-27 00:52:00 +02:00
Pavel Šimerda
afc3c2617a platform: cosmetic changes 2013-07-27 00:47:04 +02:00
Pavel Šimerda
00b63b975f platform: always cleanup nm-test-device 2013-07-27 00:47:04 +02:00
Pavel Šimerda
2ef7110f37 platform: fix memory leaks 2013-07-27 00:47:04 +02:00
Dan Williams
d83c0722da ifcfg-rh: convert test_read_wired_static_no_prefix() to a GTest 2013-07-26 16:23:23 -05:00
Dan Williams
76c09fb729 ifcfg-rh: start converting tests to GTest framework 2013-07-26 16:23:23 -05:00