Find a file
Thomas Haller 70d7d8a177 default-route: don't return devices without active connection as best_config() or best_device()
Since 0c136c1e2, we also track the default route for devices
without active-connection (unmanaged). They must not be returned
as best_config() or as best_device(), because the caller don't
expect unmanaged devices here.

This also gets closer to the original behavior of get_best_device()
before merging default-route-manager in d4417e3460
where we also would ignore devices depending on the state.

This fixes an assertion when having an interface unmanaged
and activating it externally:

    #0  0x00007ffff6806187 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
    #1  0x00007ffff6807dea in __GI_abort () at abort.c:89
    #2  0x00007ffff6c0aec5 in g_assertion_message (domain=domain@entry=0x5332d5 "NetworkManager", file=file@entry=0x539460 "nm-default-route-manager.c", line=line@entry=1056, func=func@entry=0x539920 <__FUNCTION__.28934> "_ipx_get_best_config", message=message@entry=0x8c9cb0 "assertion failed: (req)") at gtestutils.c:2356
    #3  0x00007ffff6c0af5a in g_assertion_message_expr (domain=domain@entry=0x5332d5 "NetworkManager", file=file@entry=0x539460 "nm-default-route-manager.c", line=line@entry=1056, func=func@entry=0x539920 <__FUNCTION__.28934> "_ipx_get_best_config", expr=expr@entry=0x53132f "req") at gtestutils.c:2371
    #4  0x000000000049a196 in _ipx_get_best_config (self=<optimized out>, ignore_never_default=ignore_never_default@entry=1, out_ip_iface=out_ip_iface@entry=0x7fffffffd310, out_ac=out_ac@entry=0x0, out_device=0x0, out_vpn=0x7fffffffd318, vtable=0x7a0a00 <vtable_ip4>, vtable=0x7a0a00 <vtable_ip4>) at nm-default-route-manager.c:1056
    #5  0x000000000049a3f6 in nm_default_route_manager_ip4_get_best_config (self=<optimized out>, ignore_never_default=ignore_never_default@entry=1, out_ip_iface=out_ip_iface@entry=0x7fffffffd310, out_ac=out_ac@entry=0x0, out_device=out_device@entry=0x0, out_vpn=out_vpn@entry=0x7fffffffd318) at nm-default-route-manager.c:1079
    #6  0x00000000004b7518 in update_ip4_dns (self=0x7ecac0 [NMPolicy], out_vpn=0x7fffffffd318, out_device=0x0, out_ac=0x0, out_ip_iface=0x7fffffffd310, ignore_never_default=1) at nm-policy.c:390
    #7  0x00000000004b7518 in update_ip4_dns (dns_mgr=0x8623a0 [NMDnsManager], policy=0x7ecac0 [NMPolicy]) at nm-policy.c:406
    #8  0x00000000004b99d5 in device_ip4_config_changed (device=0x8844b0 [NMDeviceEthernet], new_config=0x908aa0 [NMIP4Config], old_config=0x908aa0 [NMIP4Config], user_data=0x7ecac0) at nm-policy.c:1260
    #9  0x000000368f405d60 in ffi_call_unix64 () at /lib64/libffi.so.6
    #10 0x000000368f4057d1 in ffi_call () at /lib64/libffi.so.6
    #11 0x00007ffff6ee5b8c in g_cclosure_marshal_generic_va (closure=0x886a40, return_value=0x0, instance=0x8844b0, args_list=<optimized out>, marshal_data=0x0, n_params=2, param_types=0x87d3a0) at gclosure.c:1541
    #12 0x00007ffff6ee5144 in _g_closure_invoke_va (closure=closure@entry=0x886a40, return_value=return_value@entry=0x0, instance=instance@entry=0x8844b0, args=args@entry=0x7fffffffd810, n_params=<optimized out>, param_types=0x87d3a0) at gclosure.c:831
    #13 0x00007ffff6eff900 in g_signal_emit_valist (instance=0x8844b0, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd810) at gsignal.c:3201
    #14 0x00007ffff6f0014f in g_signal_emit (instance=instance@entry=0x8844b0, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3348
    #15 0x000000000044a1f4 in nm_device_set_ip4_config (self=self@entry=0x8844b0 [NMDeviceEthernet], new_config=new_config@entry=0x9089a0 [NMIP4Config], default_route_metric=default_route_metric@entry=100, commit=commit@entry=0, reason=reason@entry=0x0) at devices/nm-device.c:5866
    #16 0x000000000044a5af in ip4_config_merge_and_apply (self=self@entry=0x8844b0 [NMDeviceEthernet], config=config@entry=0x0, commit=commit@entry=0, out_reason=out_reason@entry=0x0) at devices/nm-device.c:3037
    #17 0x000000000044b4fd in update_ip_config (self=self@entry=0x8844b0 [NMDeviceEthernet], initial=initial@entry=0) at devices/nm-device.c:6617
    #18 0x000000000044bc39 in queued_ip_config_change (user_data=<optimized out>) at devices/nm-device.c:6688
    #19 0x00007ffff6be4e1b in g_main_context_dispatch (context=0x7ba3a0) at gmain.c:3122
    #20 0x00007ffff6be4e1b in g_main_context_dispatch (context=context@entry=0x7ba3a0) at gmain.c:3737
    #21 0x00007ffff6be51b0 in g_main_context_iterate (context=0x7ba3a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
    #22 0x00007ffff6be54d2 in g_main_loop_run (loop=0x7ba460) at gmain.c:4002
    #23 0x000000000043291d in main (argc=1, argv=0x7fffffffdef8) at main.c:442

Fixes: da708059da
(cherry picked from commit aadef137b4)
2015-01-26 18:34:25 +01:00
callouts dispatcher: pass CONNECTION_FILENAME to dispatcher scripts 2015-01-14 11:35:17 -05:00
clients cli: add description for certificate properties in editor (rh #1182575) 2015-01-20 14:37:39 +01:00
contrib/fedora ifcfg-rh: allow handling complex routing rules via dispatcher (rh #1160013) 2015-01-14 11:35:17 -05:00
data core: tell systemd to restart NetworkManager.service if it exited with failure (bgo #741587) 2014-12-17 00:03:08 +01:00
docs docs: fix out-of-tree build 2015-01-03 13:13:59 +01:00
examples ifcfg-rh: allow handling complex routing rules via dispatcher (rh #1160013) 2015-01-14 11:35:17 -05:00
include all: move STRLEN() macro to global header nm-utils-internal.h 2014-12-18 17:38:35 +01:00
initscript remove paldo initscript 2013-05-06 16:33:14 +02:00
introspection vlan: export parent device for VLANs as D-Bus property 2014-11-24 10:33:13 +01:00
libnm libnm: drop libdbus-glib from pkg-config file 2015-01-22 13:31:45 -06:00
libnm-core bond: normalize bond mode to string notation (rh #1171009) 2015-01-21 12:18:15 -05:00
libnm-glib libnm-glib/nm-client: zero the CheckConnectivityData structure 2015-01-08 16:16:18 +01:00
libnm-util libnm-core, libnm-util: belatedly update NM_VERSION_CUR_STABLE 2015-01-21 12:10:48 -05:00
m4 build: fix wrongly linking against libreadline in all applications 2014-11-26 11:43:23 +01:00
man man: add description of BOOTPROTO to nm-settings-ifcfg-rh manpage 2015-01-15 13:24:18 +01:00
po po: update Polish (pl) translation (bgo #743500) 2015-01-26 12:15:26 +01:00
policy policy: allow non-local admin sessions to control the network (rh #1145646) 2014-10-13 15:58:46 -05:00
src default-route: don't return devices without active connection as best_config() or best_device() 2015-01-26 18:34:25 +01:00
tools libnm/tests: fix GetAccessPoints() in test-networkmanager-service.py for hidden APs 2015-01-05 14:19:55 +01:00
vapi vapi: add some missing device and setting types 2015-01-23 15:37:47 -06:00
.dir-locals.el misc: add toplevel .dir-locals file that tells Emacs to show trailing whitespace 2013-03-08 15:15:28 +01:00
.gitignore cli, libnm: don't use D-Bus-specific documentation in nmcli 2014-11-19 09:24:10 -05:00
AUTHORS Update authors 2008-11-19 23:33:18 +00:00
autogen.sh build: remove setup of git-submodules in autogen.sh 2014-07-15 22:50:36 +02:00
ChangeLog fix typos in documentation and messages 2014-04-03 17:12:31 +02:00
configure.ac build: replace echo -n by printf '%s' in configure.ac 2015-01-25 14:57:01 +01:00
CONTRIBUTING doc: update code style docs 2009-10-07 12:28:10 -07:00
COPYING docs: create new master NM documentation module 2011-02-16 16:24:16 -06:00
MAINTAINERS Update MAINTAINERS 2007-09-02 23:57:41 +00:00
Makefile.am libnm: port to GDBus 2014-09-18 11:51:09 -04:00
Makefile.glib build: update Makefile.glib 2013-04-19 10:52:21 -04:00
NetworkManager.pc.in build: update NetworkManager.pc 2013-01-29 16:17:30 -05:00
NEWS release: update NEWS 2014-12-18 12:06:52 -06:00
README trivial: typo fixes 2010-09-25 00:34:10 -05:00
TODO todo: remove item about finished VPN IPv6 support 2013-04-10 10:06:38 -05:00
valgrind.suppressions test: add valgrind suppressions 2014-02-18 20:33:10 +01:00

******************
2008-12-11: NetworkManager core daemon has moved to git.freedesktop.org!

git clone git://git.freedesktop.org/git/NetworkManager/NetworkManager.git
******************


Networking that Just Works
--------------------------

NetworkManager attempts to keep an active network connection available at all
times.  The point of NetworkManager is to make networking configuration and
setup as painless and automatic as possible.  NetworkManager is intended to
replace default route, replace other routes, set IP addresses, and in general
configure networking as NM sees fit (with the possibility of manual override as
necessary).  In effect, the goal of NetworkManager is to make networking Just
Work with a minimum of user hassle, but still allow customization and a high
level of manual network control.  If you have special needs, we'd like to hear
about them, but understand that NetworkManager is not intended for every
use-case.

NetworkManager will attempt to keep every network device in the system up and
active, as long as the device is available for use (has a cable plugged in,
the killswitch isn't turned on, etc).  Network connections can be set to
'autoconnect', meaning that NetworkManager will make that connection active
whenever it and the hardware is available.

"Settings services" store lists of user- or administrator-defined "connections",
which contain all the settings and parameters required to connect to a specific
network.  NetworkManager will _never_ activate a connection that is not in this
list, or that the user has not directed NetworkManager to connect to.


How it works:

The NetworkManager daemon runs as a privileged service (since it must access
and control hardware), but provides a D-Bus interface on the system bus to
allow for fine-grained control of networking.  NetworkManager does not store
connections or settings, it is only the mechanism by which those connections
are selected and activated.

To store pre-defined network connections, two separate services, the "system
settings service" and the "user settings service" store connection information
and provide these to NetworkManager, also via D-Bus.  Each settings service
can determine how and where it persistently stores the connection information;
for example, the GNOME applet stores its configuration in GConf, and the system
settings service stores it's config in distro-specific formats, or in a distro-
agnostic format, depending on user/administrator preference.

A variety of other system services are used by NetworkManager to provide
network functionality: wpa_supplicant for wireless connections and 802.1x
wired connections, pppd for PPP and mobile broadband connections, DHCP clients
for dynamic IP addressing, dnsmasq for proxy nameserver and DHCP server
functionality for internet connection sharing, and avahi-autoipd for IPv4
link-local addresses.  Most communication with these daemons occurs, again,
via D-Bus.


Why doesn't my network Just Work?

Driver problems are the #1 cause of why NetworkManager sometimes fails to
connect to wireless networks.  Often, the driver simply doesn't behave in a
consistent manner, or is just plain buggy.  NetworkManager supports _only_
those drivers that are shipped with the upstream Linux kernel, because only
those drivers can be easily fixed and debugged.  ndiswrapper, vendor binary
drivers, or other out-of-tree drivers may or may not work well with
NetworkManager, precisely because they have not been vetted and improved by the
open-source community, and because problems in these drivers usually cannot
be fixed.

Sometimes, command-line tools like 'iwconfig' will work, but NetworkManager will
fail.  This is again often due to buggy drivers, because these drivers simply
aren't expecting the dynamic requests that NetworkManager and wpa_supplicant
make.  Driver bugs should be filed in the bug tracker of the distribution being
run, since often distributions customize their kernel and drivers.

Sometimes, it really is NetworkManager's fault.  If you think that's the case,
please file a bug at http://bugzilla.gnome.org and choose the NetworkManager
component.  Attaching the output of /var/log/messages or /var/log/daemon.log
(wherever your distribution directs syslog's 'daemon' facility output) is often
very helpful, and (if you can get) a working wpa_supplicant config file helps
enormously.