Commit graph

6860 commits

Author SHA1 Message Date
Dan Williams 0b33b42771 Revert "libnm-glib: fix vpn-state-changed signal handling"
This reverts commit 4d635b23cb.

The original commit that changed this D-Bus signal signature was
in error and we shouldn't change the D-Bus API here.
2012-06-29 15:18:12 -05:00
Dan Williams 37deed816a Revert "api: fix VpnStateChanged signal arguments"
This reverts commit 9d85378045.

The original commit that changed this D-Bus signal signature was
in error and we shouldn't change the D-Bus API here.
2012-06-29 15:17:18 -05:00
Jiří Klimeš b8958f27ea docs: fix some annotations in libnm-glib 2012-06-29 14:49:18 +02:00
Jiří Klimeš 4d635b23cb libnm-glib: fix vpn-state-changed signal handling
Core D-Bus VpnStateChanged signal changed. In order to receive the signal,
the parameters was fixed. This commit also adjusts libnm-glib's vpn-state-changed
signal to match the D-Bus one.
2012-06-29 14:16:45 +02:00
Jiří Klimeš 9d85378045 api: fix VpnStateChanged signal arguments
The signal has changed in commit 330247399c
2012-06-29 13:17:09 +02:00
Jiří Klimeš f8bef2c10b docs: fix a few documentation errors 2012-06-29 11:49:51 +02:00
Dan Williams 4a2b1d631b api: fix device state reason code enum value
Probably a merge error.
2012-06-28 16:36:16 -05:00
Dan Williams c2e25dfedc core: move failure logging to device superclass 2012-06-28 16:34:08 -05:00
Dan Williams 3ed3485a2f wifi: remove unused code 2012-06-28 16:34:08 -05:00
Dan Williams 582cb7d271 wifi: merge two functions
No point in having them separate.
2012-06-28 16:34:08 -05:00
Daniel Mustieles 85270617eb po: updated Spanish translation (bgo #679050) 2012-06-28 15:23:07 +02:00
Dan Williams 772d03fa79 release: bump version to 0.9.5.95 (0.9.6-rc1) 2012-06-27 10:40:03 -05:00
Dan Williams d40399d285 release: update NEWS 2012-06-27 10:33:13 -05:00
Dan Williams 74e262b303 agents: add a "user-requested" flag to secret agent requests
Allows agents to provide different behavior depending on whether the
secrets request was initiated by a user (eg by picking a connection
from a UI menu or by 'nmcli con up') or was automatically started by
NetworkManager.

See https://bugzilla.gnome.org/show_bug.cgi?id=660293
2012-06-27 09:42:47 -05:00
Pavel Šimerda c3b29cec71 ip6: only change ra_flags with device_set_ra_flags()
Move ra_flags modifications to a dedicated function that
logs the change (if any). Also improve device_set_state()
so that both functions return TRUE if the value actually
changes.
2012-06-26 23:50:19 -05:00
Pavel Šimerda e88aa72e6a ip6: rename defgw to gateway
This was suggested by Dan Winship but it didn't get to commit
8a059b1 by mistake.
2012-06-26 23:50:19 -05:00
Pavel Šimerda 64bac49934 ip6: remove duplicate dhcp_opts from CallbackInfo
It is now included in NMIP6Device instance already included
in CallbackInfo.
2012-06-26 23:50:19 -05:00
Tore Anderson 7575f4d1e4 mobile: enable IPv6CP
This patch lets pppd negotiate IPv6 parameters using IPV6CP. It allows
dual-stack mobile broadband to work correctly.

Due to the fact that ModemManager hard-codes use of IPv4-only PDP type,
the PDP context must manually be defined first using for example
AT+CGDCONT=1,"IPV4V6","apn". (ModemManager does not overwrite an
already-defined PDP context with the correct APN.)

IPV6CP is not considered essential, so when connecting using an IPv4-
only PDP context, pppd gives up after a retransmitting a few IPV6CP
ConfReqs. The retransmissions happen asynchronously, pppd nor NM waits
for them to finish before activating the IPv4 part of the connections.

The patch also makes pppd support IPv6-only connections (because IPCP
isn't considered essential by pppd either), however NM will currently
fail the entire connection if IPCP/IPv4 doesn't succeed.
2012-06-26 23:50:18 -05:00
Alban Browaeys 157f184706 libnm-glib: introspection - build against internal libnm-util
https://bugzilla.gnome.org/show_bug.cgi?id=676530
2012-06-26 14:45:54 -04:00
Matej Urbančič 09c2319438 po: updated Slovenian translation (bgo #678499) 2012-06-25 13:04:19 +02:00
Dan Williams 7a6baa8ab4 vpn: ensure secrets requests fail when exhausted
If the plugin says the user-provided secrets are insufficient,
make sure we fail instead of potentially overrunning the secrets
counter (which triggered an assert).
2012-06-22 15:03:05 -05:00
Jiří Klimeš 4938996973 ifcfg-rh: fix unescaping single quotes in WPA passphrases (WPA_PSK) (rh #833616)
When the last character of the PSK was a backslash and the whole PSK was
enclosed in single quotes, the unquoting/unescaping code mistakenly took
trailing \' as an escaped quote and thus changed \ to '.

See also 79757f10f3 (that introduced the code).
2012-06-22 13:04:18 +02:00
Pavel Šimerda c0048e7b40 ip6: implement router solicitation and use it to for RDNSS/DNSSL (bgo #753482)
This commit includes Dan Winship's implementation of IPv6
router solicitation. It also uses it as a last resort
for RDNSS and DNSSL lifetime expiry. While using RS to prevent
lifetime expiry may be deprecated and removed in the future,
the RS implementation is useful in other places too.

It can be also viewed as a last resort if commit e1cfdd5 gets
reverted/modified or if it does not work under some weird
circumstances.

It also includes improvements by cyphermox and me.
2012-06-15 10:43:01 -05:00
Pavel Šimerda c0d2ad5807 ip6: pad RDNSS and DNSSL lifetimes to a minimum lifetime value (rh #753482)
RFC 6106 says, section 5.1 says:

  In order to provide fixed hosts
  with stable DNS service and allow mobile hosts to
  prefer local RDNSSes to remote RDNSSes, the value of
  Lifetime SHOULD be bounded as
  MaxRtrAdvInterval <= Lifetime <= 2*MaxRtrAdvInterval

I have reported and repeatedly confirmed that values in this interval
trigger frequent RDNSS expiration on unreliable links such as 802.11
wifi. Wireless links *do* have packet loss and actually have a *much*
worse multicast packet loss than unicast. And regular router
advertisements are sent as multicast packets (in multicast frames).

In case of RDNSS expiration, NetworkManager tears down the whole
connection. That of course affects IPv4 networking as well as IPv6.
In a typical wireless network with radvd serving RDNSS it leads to
dropping network connection every ~10 minutes.

This commit improves the previous hack in 0b8ee13 by enforcing a minimum
lifetime of two hours (7200 seconds), which is four times the maximum
allowed value for MaxRtrAdvInterval (see below). We could use
AdvDefaultLifetime instead (as suggested by tore_ on IRC) but it doesn't
seem to be accessible through netlink.

RFC 4861 Neighbor Discovery for IP version 6 (IPv6):

  MaxRtrAdvInterval

  The maximum time allowed between sending
  unsolicited multicast Router Advertisements from
  the interface, in seconds.  MUST be no less than 4
  seconds and no greater than 1800 seconds.

This solution is not recommended by any RFC (and is in fact against
RFC 6106) but it's the easiest hack to fix the problem until IETF
takes action.

My original posting to IETF can be found here:

http://www.ietf.org/mail-archive/web/ipv6/current/msg15816.html
2012-06-15 10:35:04 -05:00
Dan Williams 2a5fb5b868 vpn: fix resetting parent device routing on disconnect
1fd11bd8d1 consolidated VPN connection
state handling, but that had the effect of making vpn_cleanup() be
called after all other handlers had processed the VPN connection
state change.  This meant that the code in vpn_cleanup() that
reapplies the parent device's IP configs ran last, and that code
flushes routes on the device before reapplying them.  Since the
policy is a listener on the VPN state change signals, it was
running the default routing updates before vpn_cleanup() got run,
resulting in vpn_cleanup()'s calls to nm_system_apply_ip4_config()
and nm_system_apply_ip6_config() blowing the default route away
which the policy had just set.

Fix that by moving the VPN routing cleanups into the policy, where
most of the routing decisions currently live, causing them to be
run before the default route is fixed up.
2012-06-15 10:14:11 -05:00
Dan Williams 202b693bd8 libnm-glib: don't try to free unset GValues when disconnecting VPNs
IPv6-capable plugins will fill these in, but old IPv4-only won't,
so don't try to free the GValues when they aren't set.
2012-06-14 18:05:16 -05:00
Dan Williams 26b833cd53 core: more VPN activated/deactivated fixups
More fallout from 330247399c.
2012-06-14 18:01:58 -05:00
Dan Williams bb75026004 core: ensure VPN DNS information is used
The patches that reduced the frequency of changes to /etc/resolv.conf
failed to prefer the VPN DNS information.  Even though a VPN may not
be allowed to receive the default route, its DNS information still
needs to be higher priority than interface DNS info, otherwise no
sites on the VPN will be accessible due to glibc's in-order querying
of entries in /etc/resolv.conf.
2012-06-14 17:41:52 -05:00
Colin Walters c9aa5f76cf Fix various bits of broken gtk-doc
There was some duplication, syntax errors, etc.
2012-06-14 13:56:48 -04:00
Dan Winship 83760a7ffb libnm-glib: add NM_VPN_PLUGIN_UI_CAPABILITY_IPV6 2012-06-14 11:36:55 -04:00
Alberto Ruiz d2ae2dedef libnm-glib: add missing nm-connection.h header for NMConnection (bgo #678093) 2012-06-14 15:50:24 +02:00
Dan Williams 526de78113 vpn: update VPN service object for VPN connection state change signal changes
This bit was forgotten in 330247399c.
2012-06-13 16:05:58 -05:00
Dan Williams 4004b828c2 trivial: use constant for a signal name 2012-06-13 16:05:47 -05:00
Alberto Ruiz 330998a837 vala: bumped the VAPIGEN version to 0.17.1.24 to make sure it includes the dbus-glib-1.vapi fixes 2012-06-13 13:07:56 -05:00
Alberto Ruiz 9f9d439faf vala: include local copy of Makefile.vapigen instead of the global one 2012-06-13 13:07:33 -05:00
Jiří Klimeš 495fae7a7b examples: add a python GObject Introspection example
It demonstrates getting NMIP4Config object after activating a device.
2012-06-13 13:28:43 +02:00
Alberto Ruiz b1e1ee79bd vala: add vala bindings for libnm-util and libnm-glib
This patch adds the autotools facilities to generate vapi files so that
libnm-util and libnm-glib can be consumed from Vala.

It depends on vapigen and it is a soft dependency.
2012-06-12 16:31:20 -05:00
Dan Williams 4366fd2f84 docs: fix some annotations and documentation 2012-06-12 12:12:35 -05:00
Dan Williams dcceaf40c0 release: update NEWS 2012-06-12 11:50:20 -05:00
Dan Williams 5003153297 core: move DNS change handling to the policy and optimize DNS updates (bgo #676778)
Consolidate all the DNS handling in the policy instead of sprinkling
it around in the device and vpn code.  This allows us to batch the
updates and thus reduce the number of times resolv.conf needs to
be written.  It's also easier to follow when and why the changes
occur.
2012-06-12 10:00:03 -05:00
Dan Williams 330247399c vpn: emit both new and old states in state-changed signal
Various listeners (well, really only the policy) will want the old
state too.
2012-06-12 10:00:03 -05:00
Dan Williams cb0c2b4e82 trivial: use the constant for NM_IP*_COMPARE_FLAG_ALL 2012-06-12 10:00:03 -05:00
Dan Williams 2384dea3b7 policy: split routing and DNS updates
They won't always be updated together; if the hostname changes we
don't need to update routing, and if new routes show up we don't
need to update DNS.  This also makes it a lot clearer what's
going on in the routing and DNS update functions.
2012-06-12 10:00:03 -05:00
Dan Williams e48c681bb0 core: add device IPv4 and IPv6 config change signals
We'll use these later to pull the DNS manager code out of the device
class and into the policy.
2012-06-12 10:00:03 -05:00
Dan Williams 220d96ce72 trivial: whitespace fixups and signal name definition 2012-06-12 10:00:03 -05:00
Dan Williams 1fd11bd8d1 vpn: consolidate VPN connection state handling
There used to be two places state was handled: the function that was
called to change the state, and the object method handler for the
VPN connection class.  Since the object method handler was marked
RUN_FIRST in it's g_signal_new() definition, we were destroying
internal class data (like the IPv4 config and IP iface) before other
listeners were able to deal with the state change.

That's all kinda pointless.  Just consolidate the state change
handling and make all the cleanup for the DISCONNECTED/FAILED
states happen after other listeners have had a chance to process
the signal.  It also makes the state change handling a lot clearer.
2012-06-12 10:00:03 -05:00
Dan Williams f76aa4f77c dns: fix change hashing and add batch update functions
The previous code did a cheap hash based on pointers, under the
assumption that the IP configs don't get recreated.  But with IPv6
the IP6 config that's eventually applied is a composite of the
DHCPv6 and the RA information, and is thus recreated each time
something in the DHCPv6 or RA changes. Switch to actually hashing
the IP config data and its order to prevent this problem.

Next, add functions to signal that a batch of updates will be
started, and to only commit those updates when all of them
have landed, and if they have actually changed anything.  We'll
use these functions later to reduce the number of changes
that get made to /etc/resolv.conf.
2012-06-12 09:58:05 -05:00
Dan Williams 90fb53de4c core: add hashing to IP config objects
We'll use this later to determine whether sets of IPxConfig
objects have actually changed without comparing them all
at once.
2012-06-12 09:37:26 -05:00
Alberto Ruiz 9966ac45fa introspection: fix wrong symbol prefix in the Makefile (bgo #677498)
While the python and JS bindings don't have an issue with "nm_",
the Vala ones apparently do.
2012-06-11 15:03:01 -05:00
Dan Williams 53f6539f54 examples: add simply python GObject Introspection example
Unfortunately since libnm-glib/libnm-util make heavy use of
GHashTable and GValue, functions that deal with these types
can't be used from Python when using GObject Introspection,
since pygobject can't handle conversion between python types
and GValue/GHashTable very well.  You'll likely encounter
assertions like:

ERROR:pygi-argument.c:1755:_pygi_argument_to_object: assertion failed: (g_type_info_get_tag (key_type_info) != GI_TYPE_TAG_VOID)
Aborted
2012-06-11 14:46:33 -05:00