Commit graph

3167 commits

Author SHA1 Message Date
Dan Williams
ef4f6a2e55 rfkill: detect "acpi" subsystem devices as platform devices (bgo #680632)
Some rfkill drivers (sony-laptop, ideapad-laptop, classmate-laptop,
etc) register their rfkill drivers under the "acpi" subsystem instead
of the platform subsystem, but the semantics are the same.
2012-08-17 15:31:57 -05:00
Dan Williams
0065165901 rfkill: fix up grandparent driver name detection 2012-08-17 15:28:17 -05:00
Dan Williams
ee920262ac rfkill: better logging of platform switches and states 2012-08-17 15:27:58 -05:00
Dan Williams
3ba28d9b16 wifi: ensure hidden SSIDs get added to AvailableConnections
Hidden SSIDs won't always show up in the scan list, so they need
to be present in AvailableConnections even if we don't see them
int he scan list.
2012-08-16 13:16:42 -05:00
Dan Williams
e962f06253 keyfile: use friendly MAC address format for WiMAX 2012-08-15 16:51:59 -05:00
Nathanael D. Noblet
808136ac02 core: add AvailableConnections property for NMDevice objects
Implements a new property that provides a list of currently
available connections a device could connect to. For example
if a connection for a particular wireless connection exists and
that wireless network appears in the scan list it would show in the
AvailableConnections property of the device.

(dcbw: found a slightly cleaner way to do this; it's a lot like the
check_connection_compatible class method, except it deals with
live network data too.  So convert the subclass methods to
just check additional live network data, and have the base
device class handle adding the connection to the hash and all
the associated signalling.  Also fix a bug where the available
connections were not updated when a device moved from UNAVAILABLE
to available, its available connections were not updated)
2012-08-15 16:50:49 -05:00
Paul Menzel
b2d97cc96c ifnet: fix typo fut*u*re 2012-08-15 14:24:50 -05:00
Pavel Šimerda
3e0f1d9129 dns: remove broken bind plugin 2012-08-15 12:24:20 -05:00
Dan Williams
ad49bc7b8e wimax: add missing copyright header 2012-08-06 17:58:16 -05:00
Dan Williams
1d7949e66c build: fix up includes; prefer builddir over srcdir
WiMAX failed distcheck if the iwmxsdk devel files were installed but
--enable-wimax=no was used, since the distcheck configure bits found
the iwmxsdk headers, defaulted WiMAX support to 'on', and then proceeded
to use the generated headers from the top srcdir, where of course
wimax was turned off (due to --enable-wimax=no).  Instead, everything
should use the headers from the builddir, which reflects the options
that 'make distcheck' actually selects.

At the same time, re-order various includes everywhere to ensure that
the builddir paths come before the srcdir paths to prevent this from
happening in the future.
2012-08-06 17:27:17 -05:00
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