Commit Graph

7207 Commits

Author SHA1 Message Date
Ross Vandegrift
43d4d16b5b ifupdown: Allow netmask to be CIDR-style prefix length (bgo #679123) 2012-08-06 15:07:42 -05:00
Pavel Šimerda
4fdca493ad ifupdown: testcase for CIDR-style prefix length (bgo #679123) 2012-08-06 15:07:42 -05:00
Dan Williams
f3b7e71b34 core: fix compat VLAN interface addition when interface already exists
If the interface already exists, the compat code would fail.  Fix that
and clean up the function.  Also double-check that an existing VLAN
interface that has the name we expect also has the master and VLAN
ID we expect.
2012-08-06 13:05:05 -05:00
Dan Williams
82f4fd6545 core: add compat function for determining interface type
libnl2 and earlier do not implement rtnl_link_get_kernel() and
thus we need compat code to determine whether an interface is
a bond or a VLAN.  Previously, the VLAN code would simply assert
and cause NM to exit when running with libnl2 or earlier because
the interface type could not be determined.
2012-08-02 20:56:46 -05:00
Dan Williams
54dd265001 core: don't generate WiMAX glib enums when WiMAX isn't enabled
The enum generator stuff apparently includes any #include in source or
header files that it's given, which was causing nm-enum-types.c to
include files from the Intel WiMAX SDK even when WiMAX wasn't enabled.
2012-08-02 15:39:02 -05:00
Dan Winship
a13d4e9d3d build: fix build after addition of new warnings 2012-08-01 09:48:03 -04:00
Jiří Klimeš
edb85e9720 core: fix NM_IS_*_CLASS(klass) macros
The argument is 'klass' not 'obj'.
2012-07-27 13:15:54 +02:00
Jiří Klimeš
915cfe8ce8 docs: update FSF address in license headers 2012-07-26 16:25:20 +02:00
Jakub Dorňák
ac152ece02 dnsmasq: allow custom configuration via files in /etc/NetworkManager/dnsmasq.d (bgo #679628)
We don't use the default dnsmasq directory because packages often drop files
there that don't take account of NM's specific use-case and end up conflicting
with the specific local caching nameserver functionality that NM uses dnsmasq
for.  NM's private dnsmasq is orthogonal to whatever global dnsmasq
daemon may be running, and with that daemons configuration.

(dcbw: change directory to private one)
2012-07-25 13:18:14 -05:00
Jiří Klimeš
e0e804b30b bluetooth: fix a typo in dbus_g_error_has_name() function name 2012-07-25 16:00:05 +02:00
Dan Williams
1f4b97c878 bluetooth: ignore more Bluez launch failures
If bluez is started by systemd but for some reason is not set to
be D-Bus activated (as seems to be the case on Fedora 16 and later),
then don't emit a warning.
2012-07-24 12:57:42 -05:00
Dan Williams
346a1dc957 core: suppress a warning when a connection is assumed
When NM takes over a device's existing connection, it'll jump right
from "unavailable" to "ip-config" states, thus leading to the
warning.
2012-07-24 12:12:18 -05:00
Pavel Šimerda
a1659adec0 ip4: fix connection assumption 2012-07-24 10:17:47 -05:00
Dan Winship
3324bd2cdf ifcfg-rh: ignore IP config on bond slaves
NM was requiring that bond slaves have either no IP config or an
explicit "none"/"disabled" config. But the system scripts just ignore
any IP config that is present on a slave, so change NM to do that too
(but warn about it).

https://bugzilla.redhat.com/show_bug.cgi?id=838907
2012-07-23 12:52:32 -04:00
Dan Williams
c357d5fbe5 bluetooth: suppress another Bluez warning (rh #840580)
When Bluez can't be launched for some reason, like because it
doesn't exist, ignore that.
2012-07-20 14:47:41 -05:00
Jiří Klimeš
974c39fe3e ifcfg-rh: fix a segfault when unescaping a string (rh #841391)
The crash occured for variables like these:
VAR="
VAR='
2012-07-19 14:30:29 +02:00
Jiří Klimeš
21fa0f8349 settings: fix keyfile plugin priority when explicitly configured (bgo #679655)
The regression was introduced by b38f39cfc6 that
built keyfile plugin into NM (instead of using .so).
2012-07-10 16:04:14 +02:00
Jiří Klimeš
8aedcb95ed config: fix return value in g_return_val_if_fail() - it's unsigned 2012-07-09 16:42:01 +02:00
Jiří Klimeš
173b458da9 core: describe arguments for --connectivity-* options 2012-07-09 16:21:11 +02:00
Jiří Klimeš
d73f11aefa core: mark cmd options for translation 2012-07-09 16:21:11 +02:00
Armin K
b37ed68e18 backends: add Linux From Scratch (LFS) support (bgo #679202) 2012-07-02 12:54:12 +02:00
Dan Williams
815a0b18e1 vpn: restore VpnStateChanged D-Bus signal API
The DNS change frequency reduction patches mistakenly changed the signature
of the VpnStateChanged signal.  Fix that, since we try really really
hard not to break the D-Bus API in stable branches.  My bad...
2012-06-29 15:37:00 -05:00
Jiří Klimeš
f8bef2c10b docs: fix a few documentation errors 2012-06-29 11:49:51 +02: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
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
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
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
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
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
Jiří Klimeš
af0eb9e7ad core: don't default to IPv6 temp addr while completing connection (bgo #633233)
Enabling NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR in
nm_device_complete_connection() made IPv6 temp address enabled for connections
created via AddAndActivateConnection() D-Bus call. But it is disabled for other
connections. That is not much consistent. So, do not enable IPv6 privacy when
completing connections and leave it up to users, who would like to use IPv6
Privacy Extensions, to enable it manually.
2012-06-11 09:32:49 +02:00