Find a file
Lubomir Rintel 741be402fb modem-broadband: ignore late callbacks
If libmm invokes callbacks after the connect context has been disposed
we should just ignore them. Fixes crash on dereferencing already freed
connect context (due to explicit disconnection while the modem is
connecting):

  NetworkManager[29074]: <info>  [1462383917.8718] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.8719] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.8720] device (ttyACM1): state change: deactivating -> disconnected (reason 'connection-removed') [110 30 38]
  NetworkManager[29074]: <info>  [1462383917.8758] (ttyACM1): modem state changed, 'connecting' --> 'disconnecting' (reason: user-requested)
  NetworkManager[29074]: <warn>  [1462383917.8909] (ttyACM1): failed to connect modem: Dial operation has been cancelled

  (NetworkManager:29074): NetworkManager-wwan-CRITICAL **: modem_prepare_result: assertion 'state == NM_DEVICE_STATE_PREPARE' failed
  NetworkManager[29074]: <info>  [1462383917.8912] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.8913] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.9693] (ttyACM1): modem state changed, 'connecting' --> 'registered' (reason: user-requested)

  Program received signal SIGSEGV, Segmentation fault.
  connect_ready (simple_iface=<optimized out>, res=0x7fffe0009200, self=0x555555a8d670 [NMModemBroadband]) at nm-modem-broadband.c:329
  329                     if (!ctx->first_error) {
  (gdb) bt
  #0  0x00007fffea01272a in connect_ready (simple_iface=<optimized out>, res=0x7fffe0009200, self=0x555555a8d670 [NMModemBroadband]) at nm-modem-broadband.c:329
  #1  0x00007ffff546a297 in g_simple_async_result_complete (simple=0x7fffe0009200 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
  #2  0x00007fffe9d82fec in connect_context_complete_and_free (ctx=ctx@entry=0x7fffdc00c550) at mm-modem-simple.c:93
  #3  0x00007fffe9d83155 in simple_connect_ready (self=0x7fffdc00c960 [MMModemSimple], res=0x555555a7c2b0, ctx=0x7fffdc00c550) at mm-modem-simple.c:159
  #4  0x00007ffff547af93 in g_task_return_now (task=0x555555a7c2b0 [GTask]) at gtask.c:1106
  #5  0x00007ffff547b62e in g_task_return (task=0x555555a7c2b0 [GTask], type=<optimized out>) at gtask.c:1164
  #6  0x00007ffff54d4239 in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x555555a7c2b0) at gdbusproxy.c:2570
  #7  0x00007ffff547af93 in g_task_return_now (task=0x7fffdc004470 [GTask]) at gtask.c:1106
  #8  0x00007ffff547b62e in g_task_return (task=0x7fffdc004470 [GTask], type=<optimized out>) at gtask.c:1164
  #9  0x00007ffff54c8c9f in g_dbus_connection_call_done (source=<optimized out>, result=0x7fffe00036f0, user_data=0x7fffdc004470) at gdbusconnection.c:5702
  #10 0x00007ffff547af93 in g_task_return_now (task=0x7fffe00036f0 [GTask]) at gtask.c:1106
  #11 0x00007ffff547afc9 in complete_in_idle_cb (task=0x7fffe00036f0) at gtask.c:1120
  #12 0x00007ffff4eb7d7a in g_main_context_dispatch (context=0x555555a4a000) at gmain.c:3152
  #13 0x00007ffff4eb7d7a in g_main_context_dispatch (context=context@entry=0x555555a4a000) at gmain.c:3767
  #14 0x00007ffff4eb80b8 in g_main_context_iterate (context=0x555555a4a000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
  #15 0x00007ffff4eb838a in g_main_loop_run (loop=0x555555a48780) at gmain.c:4032
  #16 0x00005555555aebf2 in main (argc=1, argv=0x7fffffffdc78) at main.c:477
  (gdb)

(cherry picked from commit aa0b379699)
2016-05-10 16:53:42 +02:00
callouts build: disable deprecation checks for internal compilation 2016-04-05 22:22:58 +02:00
clients clients: add missing openvpn secret types to secret agent 2016-05-05 14:25:12 +02:00
contrib man: move nmcli-examples to section 7 2016-04-05 14:37:51 +02:00
data systemd: order NetworkManager.serivce after network-pre.target 2016-01-23 16:54:33 +01:00
docs docs: libnm: add type headers to scan list 2016-05-07 15:34:28 +02:00
examples examples: fix crash in add-connection-libnm 2016-04-20 09:47:28 +02:00
introspection dbus: fix up the XML formatting 2016-04-05 14:37:51 +02:00
libnm docs: libnm: add doc comment to types 2016-05-07 15:34:30 +02:00
libnm-core docs: libnm: add doc comment to types 2016-05-07 15:34:30 +02:00
libnm-glib build: disable deprecation checks for internal compilation 2016-04-05 22:22:58 +02:00
libnm-util libnm-core: empty key is not a pkcs12 file 2016-04-20 10:49:34 +02:00
m4 build: compile with -Wno-duplicate-decl-specifier 2016-03-09 11:45:03 +01:00
man cli: remove version check against NM 2016-05-02 10:45:39 +02:00
po po: update Polish (pl) translation (bgo #765985) 2016-05-09 18:43:52 +02:00
policy manager: export DNS global configuration D-Bus property 2015-10-01 09:05:08 +02:00
shared build: belatedly bump version number for current and next stable 2016-05-10 13:25:39 +02:00
src modem-broadband: ignore late callbacks 2016-05-10 16:53:42 +02:00
tools tools: add forgotten file to dist 2016-04-23 20:26:16 +02:00
vapi build: make libnm-util/libnm-glib optional 2015-08-10 09:41:26 -04: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 docs: include the D-Bus enums reference with the API documentation 2016-04-22 17:14:14 +02:00
.travis.yml travis: update .travis.yml not to run tests when build fails 2016-02-16 13:01:47 +01:00
AUTHORS misc: update maintainers and authors 2016-04-21 13:39:30 -05:00
autogen.sh autogen.sh: print errors to stderr, printf instead echo -n 2015-07-02 09:55:32 +02:00
ChangeLog fix typos in documentation and messages 2014-04-03 17:12:31 +02:00
configure.ac release: bump to 1.2.1 (development) 2016-04-20 18:58:34 +02:00
CONTRIBUTING doc: update CONTRIBUTING to no longer allow // FIXME comments 2016-02-04 17:59:05 +01:00
COPYING docs: create new master NM documentation module 2011-02-16 16:24:16 -06:00
MAINTAINERS misc: update maintainers and authors 2016-04-21 13:39:30 -05:00
Makefile.am build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
Makefile.glib build: include "config.h" in nm*enum-types.c sources 2015-10-05 15:01:38 +02:00
NetworkManager.pc.in build: update NetworkManager.pc 2013-01-29 16:17:30 -05:00
NEWS release: update NEWS 2016-03-29 16:10:25 +02:00
README trivial: typo fixes 2010-09-25 00:34:10 -05:00
TODO wimax: drop WiMAX support (bgo #747846) 2015-04-17 12:42:23 -04:00
valgrind.suppressions valgrind: add suppression for glib's g_thread_return() 2015-11-16 15:58:42 +01:00
zanata.xml po: add Zanata configuration 2016-04-05 14:35:53 +02: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.