Commit Graph

13873 Commits

Author SHA1 Message Date
Thomas Haller
99c9529b15 build: add configure option for ibft plugin
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:17:55 +01:00
Thomas Haller
f77b8460d0 man: add description for ibft settings plugin to NetworkManager.conf
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:17:55 +01:00
Thomas Haller
caa1779f33 utils: fix printf format for pid_t in nm_utils_get_start_time_for_pid()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:02:04 +01:00
Dan Winship
ace746df4e platform: deal with default route being passed to route_sync() (bgo 735325)
NMIP4Configs and NMIP6Configs are never supposed to contain a default
route, and thus nm_platform_ip6_route_sync() should never have to deal
with one. Unfortunately, if it *does* get passed a default route, it
will add it even if it was already there. This will result in an
RTM_NEWROUTE notification, which will cause NMPlatform to emit
ip6-route-changed, which will result in NMDevice doing some work and
then calling nm_ip6_config_commit(), which will result in NMIP6Config
passing the same list of routes to nm_platform_ip6_route_sync() again,
including the default route, which will cause NMPlatform to add the
route again...

(Something eventually causes this cycle to get broken, but it starts
up again the next time NM receives an RA.)

Fix this by having the route_sync() functions never add/modify the
default route (They were already not deleting it.)
2014-10-29 09:14:03 -04:00
Dan Winship
9f739d0c61 rdisc: properly handle RDNSS/DNSSL forced expiration
If the router sends an RA with an RDNSS or DNSSL lifetime of "0", that
means to immediately stop using the corresponding server/domain name.
NMLNDPRDisc knew this, but messed up its handling of it, and so if
this happened, it might end up sending out an RS to get new data every
0 seconds...

(Noticed while investigating bgo 735325, though it turned out to be
irrelevant there.)
2014-10-29 09:13:36 -04:00
Thomas Haller
f1a0b4afd2 build: renable -Wstrict-prototypes compiler warning
The warning -Wstrict-prototypes was disabled by commit
db9b1df0e4 .

Enable it again, but avoid warnings for WiMax SDK by explicitly disabling the
compiler warning where needed.

Apparently clang does not produce a warning for -Wstrict-prototypes,
hence we don't need a clang specific #pragma.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 14:09:52 +01:00
Thomas Haller
dd243ceefe build: refactor compiler_warnings.m4 macro
NM_COMPILER_WARNINGS still works the same, but
rename variables to have a CFLAGS_* prefix.

Also cleanup the construction of CFLAGS by appending
to CFLAGS_MORE_WARNINGS variable instead of appending
to CFLAGS, and resetting to SAVE_CFLAGS.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 12:40:03 +01:00
Thomas Haller
b77567b225 build: fix -Wstrict-prototypes warnings
We disabled -Wstrict-prototypes in commit
db9b1df0e4 .
Fix compiler warnings.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 12:30:11 +01:00
Lubomir Rintel
5aefbe5658 libnm-core: Don't warn on missing properties
It might simply mean that the object disappeared (which is perfectly fine):

(process:7680): libnm-WARNING **: Could not fetch property 'Vpn' of interface 'org.freedesktop.NetworkManager.Connection.Active' on /org/freedesktop/NetworkManager/ActiveConnection/151: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist

https://bugzilla.gnome.org/show_bug.cgi?id=739255
2014-10-29 10:04:52 +01:00
Josef Andersson
bd2829f355 po: update Swedish (sv) translation (bgo #739304)
https://bugzilla.gnome.org/show_bug.cgi?id=739304

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 09:36:27 +01:00
Colin Walters
6d1912ff2e callouts: Mark nmdbus-dispatcher.[ch] as BUILT_SOURCES
Otherwise we might hit race conditions during build.
2014-10-28 17:50:24 -04:00
Dan Winship
85030d9131 libnm-core, libnm: remove GSLists in APIs (bgo #739023) 2014-10-28 17:23:51 -04:00
Dan Winship
6ae4224850 libnm: change GSList to GPtrArray in libnm methods
libnm mostly used GPtrArrays in its APIs, except that arrays of
connections were usually GSLists. Fix this and make them GPtrArrays
too (and rename nm_client_list_connections() to
nm_client_get_connections() to match everything else).
2014-10-28 17:17:17 -04:00
Dan Winship
9e5c7d915b libnm-core: make nm_setting_verify() take an NMConnection
nm_setting_verify() took a GSList of other NMSettings, but really it
would just be simpler all around to pass the NMConnection instead...

This means that several formerly NMSetting-branded functions that
operated on lists-of-settings now get replaced with
NMConnection-branded functions instead.
2014-10-28 17:17:17 -04:00
Dan Winship
b108790833 libnm-core: add nm-core-types.h, remove cross-includes
Add nm-core-types.h, typedefing all of the GObject types in
libnm-core; this is needed so that nm-setting.h can reference
NMConnection in addition to nm-connection.h referencing NMSetting.

Removing the cross-includes from the various headers causes lots of
fallout elsewhere. (In particular, nm-utils.h used to include
nm-connection.h, which included every setting header, so any file that
included nm-utils.h automatically got most of the rest of libnm-core
without needing to pay attention to specifics.) Fix this up by
including nm-core-internal.h from those files that are now missing
includes.
2014-10-28 17:17:17 -04:00
Dan Winship
6eba3aa141 libnm-core: #include all nm-core headers from nm-core-internal.h
The nm-core headers are all interconnected, and most .c files don't
include every header they need. As a prologue to making them less
interconnected, include everything from nm-core-internal.h, to make
it easier to fix up all the breakage.
2014-10-28 17:17:17 -04:00
Dan Winship
8c368a51ba libnm-core: hwaddr-related fixes (bgo 739023) 2014-10-28 17:08:54 -04:00
Dan Winship
b084ad7f2b libnm-core: canonicalize hardware addresses in settings
Convert hardware addresses to canonical form (uppercase, leading
zeros, colons) when setting them on/adding them to NMSetting
properties.
2014-10-28 17:08:46 -04:00
Dan Winship
61e489a736 libnm-core: add nm_utils_hwaddr_canonical()
Add a helper function for converting hardware addresses to canonical
form.
2014-10-28 17:08:46 -04:00
Dan Winship
dfcb221337 libnm-core: make _get_mac_address_blacklist() methods return arrays
Make nm_setting_wired_get_mac_address_blacklist() and
nm_setting_wireless_get_mac_address_blacklist() return a char**,
rather than a GSList.
2014-10-28 17:08:46 -04:00
Dan Winship
af3d604e4f po: fix up for NMVpnPlugin rename 2014-10-28 17:07:42 -04:00
Dan Winship
650d09baa3 libnm: rename NMVpnPlugin (bgo #739072) 2014-10-28 14:50:27 -04:00
Dan Winship
4d9cbaf9bf libnm: merge nm-vpn-plugin-utils into nm-vpn-plugin-old
The new VPN plugin API will hopefully simplify some the the tasks that
are currently handled by nm-vpn-plugin-utils functions, so make those
functions explicitly be part of the "old" API. (If we still want them
in the new API we can just move them back out, and have the "_old_"
versions just be wrappers around the undeprecated ones.)
2014-10-28 14:50:27 -04:00
Dan Winship
f452606020 libnm: rename NMVpnPlugin to NMVpnPluginOld
Rename libnm's NMVpnPlugin to NMVpnPluginOld, in preparation for
having a new-and-improved NMVpnPlugin in NM 1.2. Also remove it from
NM-1.0.gir.

Make nm-vpn-plugin-old.h be separately includable, since it's not
included from NetworkManager.h, and we probably don't want it to be.

Remove NMVpnPlugin, NMVpnPluginUiInterface, and nm-vpn-plugin-utils
from the docs, since they're basically undocumented anyway.
2014-10-28 14:50:27 -04:00
Dan Winship
1e9c5f415f libnm-core: fix trivial bug in NMVpnPluginError quark 2014-10-28 14:50:27 -04:00
Dan Williams
e01e43cd2f dhcp: suppress warning about invalid DNS servers
If the DHCP server happens to send "0.0.0.0", which you see with
some consumer gear that only has one nameserver set, don't warn
because we know it's bogus.

Also rename the copy & pasted 'searches' variable to what it's
actually used for.
2014-10-27 15:54:30 -05:00
Thomas Haller
4ae958757b core: don't use libnm-core private header outside of libnm-core/
Code outside of libnm-core/ should not include the private headers.
nm-core-internal.h should be used instead.

Fixes: 98fe073fb9

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 21:12:07 +01:00
Thomas Haller
d0535cafe5 core: merge branch 'th/bgo738941_dbus_stop' (bgo #738941)
https://bugzilla.gnome.org/show_bug.cgi?id=738941

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 20:48:45 +01:00
Thomas Haller
3423e54c4e settings: pass valid error code to g_set_error() in load_plugins()
Fixes: 7d04618645
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 20:45:23 +01:00
Thomas Haller
c7227ac734 wifi: avoid assertion about duplicate nm_device_add_pending_action()
This can be triggered by stopping the DBUS service. The assertion happens
because when the supplicant stops (due to the name-owner-change, which is triggered
because dbus-daemon quit), the supplicant manager sets all supplicant interfaces
to DOWN state so that they can be cleaned up. That does two things:

  1) calls supplicant_interface_acquire() to attempt to re-launch wpa_supplicant
     in case wpa_supplicant segfaulted

  2) moves the NMDevicWifi to UNAVAILABLE state because the supplicant is gone,
     the device is no longer usable and we must terminate the connection and wait
     for the supplicant to come back

But #2 also ends up calling supplicant_interface_acquire(), because that's what
we want to do when the NMDeviceWifi is first managed (at startup) and when the
supplicant dies.  The code just doesn't differentiate between the two cases.

To fix this, just allow duplicate "waiting for supplicant" pending
actions, which is fine because the operation doesn't care about strict
added/removed sequencing.

    #0  0x000000381d0504e9 in g_logv (log_domain=0x59cd5b "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fff8cccc1a0) at gmessages.c:989
    #1  0x000000381d05063f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1025
    #2  0x000000000044f53b in nm_device_add_pending_action (self=0xa60310, action=0x7febecd1d37d "waiting for supplicant", assert_not_yet_pending=1) at devices/nm-device.c:6466
    #3  0x00007febecd0bc56 in supplicant_interface_acquire (self=0xa60310) at nm-device-wifi.c:262
    #4  0x00007febecd0b240 in device_state_changed (device=0xa60310, new_state=NM_DEVICE_STATE_UNAVAILABLE, old_state=NM_DEVICE_STATE_ACTIVATED, reason=NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED) at nm-device-wifi.c:3136
    #5  0x000000381dc05d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #6  0x000000381dc056bc in ffi_call (cif=cif@entry=0x7fff8cccc6c0, fn=0x7febecd0b050 <device_state_changed>, rvalue=0x7fff8cccc630, avalue=avalue@entry=0x7fff8cccc5b0) at ../src/x86/ffi64.c:522
    #7  0x000000381e010ad8 in g_cclosure_marshal_generic (closure=0xa30a40, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>,
        marshal_data=0x7febecd0b050 <device_state_changed>) at gclosure.c:1454
    #8  0x000000381e010298 in g_closure_invoke (closure=closure@entry=0xa30a40, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fff8cccc8c0, invocation_hint=invocation_hint@entry=0x7fff8cccc860)
        at gclosure.c:777
    #9  0x000000381e02211b in signal_emit_unlocked_R (node=node@entry=0xa322b0, detail=detail@entry=0, instance=instance@entry=0xa60310, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fff8cccc8c0) at gsignal.c:3624
    #10 0x000000381e02a0f2 in g_signal_emit_valist (instance=instance@entry=0xa60310, signal_id=signal_id@entry=63, detail=detail@entry=0, var_args=var_args@entry=0x7fff8ccccaf8) at gsignal.c:3330
    #11 0x000000381e02a8f8 in g_signal_emit_by_name (instance=0xa60310, detailed_signal=0x59a8d1 "state-changed") at gsignal.c:3426
    #12 0x00000000004514a4 in _set_state_full (self=0xa60310, state=NM_DEVICE_STATE_UNAVAILABLE, reason=NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED, quitting=0) at devices/nm-device.c:6820
    #13 0x0000000000449ec6 in nm_device_state_changed (self=0xa60310, state=NM_DEVICE_STATE_UNAVAILABLE, reason=NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED) at devices/nm-device.c:6949
    #14 0x00007febecd0f247 in supplicant_iface_state_cb (iface=0x9b9290, new_state=13, old_state=12, disconnect_reason=0, user_data=0xa60310) at nm-device-wifi.c:2276
    #15 0x000000381dc05d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #16 0x000000381dc056bc in ffi_call (cif=cif@entry=0x7fff8cccd230, fn=0x7febecd0eb20 <supplicant_iface_state_cb>, rvalue=0x7fff8cccd160, avalue=avalue@entry=0x7fff8cccd0e0) at ../src/x86/ffi64.c:522
    #17 0x000000381e010f35 in g_cclosure_marshal_generic_va (closure=0xa2f490, return_value=0x0, instance=0x9b9290, args_list=<optimized out>, marshal_data=0x0, n_params=3, param_types=0xa422e0) at gclosure.c:1550
    #18 0x000000381e0104c7 in _g_closure_invoke_va (closure=closure@entry=0xa2f490, return_value=return_value@entry=0x0, instance=instance@entry=0x9b9290, args=args@entry=0x7fff8cccd470, n_params=3, param_types=0xa422e0) at gclosure.c:840
    #19 0x000000381e029749 in g_signal_emit_valist (instance=0x9b9290, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fff8cccd470) at gsignal.c:3238
    #20 0x000000381e02a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #21 0x00000000004b0e4b in set_state (self=0x9b9290, new_state=13) at supplicant-manager/nm-supplicant-interface.c:344
    #22 0x00000000004b0916 in smgr_avail_cb (smgr=0xa3c890, pspec=0xa3c8d0, user_data=0x9b9290) at supplicant-manager/nm-supplicant-interface.c:930
    #23 0x000000381e010298 in g_closure_invoke (closure=0x9a68b0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fff8cccd770, invocation_hint=invocation_hint@entry=0x7fff8cccd710) at gclosure.c:777
    #24 0x000000381e02235d in signal_emit_unlocked_R (node=node@entry=0x990da0, detail=detail@entry=610, instance=instance@entry=0xa3c890, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fff8cccd770) at gsignal.c:3586
    #25 0x000000381e02a0f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fff8cccd900) at gsignal.c:3330
    #26 0x000000381e02a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #27 0x000000381e014945 in g_object_dispatch_properties_changed (object=0xa3c890, n_pspecs=1, pspecs=0x0) at gobject.c:1047
    #28 0x000000381e017019 in g_object_notify_by_spec_internal (pspec=<optimized out>, object=0xa3c890) at gobject.c:1141
    #29 g_object_notify (object=0xa3c890, property_name=<optimized out>) at gobject.c:1183
    #30 0x00000000004b56f1 in set_running (self=0xa3c890, now_running=0) at supplicant-manager/nm-supplicant-manager.c:228
    #31 0x00000000004b5002 in name_owner_changed (dbus_mgr=0x99f740, name=0x9ba910 "fi.w1.wpa_supplicant1", old_owner=0xa945a0 ":1.25", new_owner=0xac2ce0 "", user_data=0xa3c890) at supplicant-manager/nm-supplicant-manager.c:294
    #32 0x000000381dc05d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #33 0x000000381dc056bc in ffi_call (cif=cif@entry=0x7fff8cccdd10, fn=0x4b4d50 <name_owner_changed>, rvalue=0x7fff8cccdc80, avalue=avalue@entry=0x7fff8cccdc00) at ../src/x86/ffi64.c:522
    #34 0x000000381e010ad8 in g_cclosure_marshal_generic (closure=0xa530a0, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x0) at gclosure.c:1454
    #35 0x000000381e010298 in g_closure_invoke (closure=0xa530a0, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fff8cccdf10, invocation_hint=invocation_hint@entry=0x7fff8cccdeb0) at gclosure.c:777
    #36 0x000000381e02235d in signal_emit_unlocked_R (node=node@entry=0x99cce0, detail=detail@entry=0, instance=instance@entry=0x99f740, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fff8cccdf10) at gsignal.c:3586
    #37 0x000000381e02a0f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fff8ccce0d0) at gsignal.c:3330
    #38 0x000000381e02a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #39 0x00000000004c4026 in proxy_name_owner_changed (proxy=0x998210, name=0xa3ad50 "fi.w1.wpa_supplicant1", old_owner=0x9cffc0 ":1.25", new_owner=0x99d230 "", user_data=0x99f740) at nm-dbus-manager.c:708
    #40 0x000000381dc05d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #41 0x000000381dc056bc in ffi_call (cif=cif@entry=0x7fff8ccce410, fn=0x4c3fd0 <proxy_name_owner_changed>, rvalue=0x7fff8ccce380, avalue=avalue@entry=0x7fff8ccce300) at ../src/x86/ffi64.c:522
    #42 0x000000381e010ad8 in g_cclosure_marshal_generic (closure=closure@entry=0x9beb80, return_gvalue=return_gvalue@entry=0x0, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=invocation_hint@entry=0x7fff8ccce630, marshal_data=marshal_data@entry=0x0) at gclosure.c:1454
    #43 0x0000003829a10864 in marshal_dbus_message_to_g_marshaller (closure=0x9beb80, return_value=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=0x7fff8ccce630, marshal_data=0x0) at dbus-gproxy.c:1736
    #44 0x000000381e010298 in g_closure_invoke (closure=0x9beb80, return_value=return_value@entry=0x0, n_param_values=3, param_values=param_values@entry=0x7fff8ccce690, invocation_hint=invocation_hint@entry=0x7fff8ccce630) at gclosure.c:777
    #45 0x000000381e02235d in signal_emit_unlocked_R (node=node@entry=0x9be290, detail=detail@entry=347, instance=instance@entry=0x998210, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fff8ccce690) at gsignal.c:3586
    #46 0x000000381e02a0f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fff8ccce840) at gsignal.c:3330
    #47 0x000000381e02a3af in g_signal_emit (instance=instance@entry=0x998210, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #48 0x0000003829a111c0 in dbus_g_proxy_emit_remote_signal (message=0xa6c2b0, proxy=0x998210) at dbus-gproxy.c:1789
    #49 dbus_g_proxy_manager_filter (connection=<optimized out>, message=0xa6c2b0, user_data=0x9be520) at dbus-gproxy.c:1356
    #50 0x000000382001006e in dbus_connection_dispatch (connection=connection@entry=0x9badb0) at dbus-connection.c:4631
    #51 0x0000003829a0ad65 in message_queue_dispatch (source=source@entry=0x9bdcc0, callback=<optimized out>, user_data=<optimized out>) at dbus-gmain.c:90
    #52 0x000000381d0492a6 in g_main_dispatch (context=0x99b4b0) at gmain.c:3066
    #53 g_main_context_dispatch (context=context@entry=0x99b4b0) at gmain.c:3642
    #54 0x000000381d049628 in g_main_context_iterate (context=0x99b4b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3713
    #55 0x000000381d049a3a in g_main_loop_run (loop=0x99b5d0) at gmain.c:3907
    #56 0x0000000000443c28 in main (argc=1, argv=0x7fff8cccf268) at main.c:704

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 20:43:58 +01:00
Thomas Haller
a7afa746f5 supplicant: avoid assertion when DBUS connection closes
Calling dbus_g_proxy_begin_call() on a closed DBUS connection will
return NULL. All the call sites of nm_call_store_add() don't check
for NULL and therefore might hit an assertion.

This can easily reproduced by stopping the DBUS daemon.
Backtrace:
    #0  0x000000381d0504e9 in g_logv (log_domain=0x59cd8b "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fff42cce5c0) at gmessages.c:989
    #1  0x000000381d05063f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1025
    #2  0x00000000004b64e9 in nm_call_store_add (store=0x7f8e1c003d20, proxy=0x219c0d0, call=0x0) at supplicant-manager/nm-call-store.c:47
    #3  0x00000000004b0b7b in interface_add (self=0x20e2500, is_wireless=1) at supplicant-manager/nm-supplicant-interface.c:907
    #4  0x00000000004b0865 in nm_supplicant_interface_new (smgr=0x216c870, ifname=0x211e840 "wlp3s0", is_wireless=1, fast_supported=1, ap_support=AP_SUPPORT_YES, start_now=1) at supplicant-manager/nm-supplicant-interface.c:1355
    #5  0x00000000004b47da in nm_supplicant_manager_iface_get (self=0x216c870, ifname=0x211e840 "wlp3s0", is_wireless=1) at supplicant-manager/nm-supplicant-manager.c:91
    #6  0x00007f8e250f8b3f in supplicant_interface_acquire (self=0x218a350) at nm-device-wifi.c:253
    #7  0x00007f8e250fc22e in supplicant_iface_state_cb (iface=0x20e2290, new_state=13, old_state=9, disconnect_reason=0, user_data=0x218a350) at nm-device-wifi.c:2274
    #8  0x000000381dc05d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #9  0x000000381dc056bc in ffi_call (cif=cif@entry=0x7fff42cced00, fn=0x7f8e250fbb20 <supplicant_iface_state_cb>, rvalue=0x7fff42ccec30, avalue=avalue@entry=0x7fff42ccebb0) at ../src/x86/ffi64.c:522
    #10 0x000000381e010f35 in g_cclosure_marshal_generic_va (closure=0x20fd2b0, return_value=0x0, instance=0x20e2290, args_list=<optimized out>, marshal_data=0x0, n_params=3, param_types=0x2189ee0) at gclosure.c:1550
    #11 0x000000381e0104c7 in _g_closure_invoke_va (closure=closure@entry=0x20fd2b0, return_value=return_value@entry=0x0, instance=instance@entry=0x20e2290, args=args@entry=0x7fff42ccef40, n_params=3, param_types=0x2189ee0)
        at gclosure.c:840
    #12 0x000000381e029749 in g_signal_emit_valist (instance=0x20e2290, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fff42ccef40) at gsignal.c:3238
    #13 0x000000381e02a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
    #14 0x00000000004b0e4b in set_state (self=0x20e2290, new_state=13) at supplicant-manager/nm-supplicant-interface.c:344

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 20:43:58 +01:00
Thomas Haller
20085b9da8 core: ignore SIGPIPE
Ignoring SIGPIPE signal, otherwise it causes problems.

For example, running `NetworkManager --debug 2>&1 | tee log.txt` in a
terminal and killing it with CTRL+C (SIGINT), will abruplty terminate
NetworkManager without clean shutdown.
Note, that with this patch and above example, NetworkManager will both
receive SIGINT and SIGPIPE. Since we now ignore SIGPIPE, NetworkManager
will shut down cleanly. Any logging output after killing `tee` is of
lost however.

Also, there might be other cases where NM reads/writes to a pipe/socket
and unexpectedly received SIGPIPE. For example nm-dns-manager.c
spawns netconfig (run_netconfig()) and writes the configuration
to its stdin. If netconfig dies, the write might fail with EPIPE.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 20:42:37 +01:00
Lubomir Rintel
38bf08ec44 wifi: Empty AP BSSID is NULL, not an invalid address
Since 3a54d050 the AP address is not a gbyte[], but a char *. The fake AP BSSID
fixup could trigger an assertion failure:

Oct 26 11:14:45 goatlord.localdomain NetworkManager[540]: nm_ethernet_address_is_valid: assertion 'addr != NULL' failed

https://bugzilla.gnome.org/show_bug.cgi?id=739258

Fixes: 3a54d05098
2014-10-27 20:34:15 +01:00
Thomas Haller
d3ebe386cc wifi: avoid assertion in nm_ap_check_compatible() when comparing AP with missing BSSID
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 20:32:39 +01:00
Thomas Haller
cc9251d631 wifi: ensure not passing NULL bssid as string to printf logging functions
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 20:32:36 +01:00
Dan Williams
6153e9e78d merge: fix default-unmanaged devices being unavailable for activation (bgo #738588) 2014-10-27 13:46:30 -05:00
Dan Williams
d147c26517 core: autoconnect fixes for default-unmanaged devices and property notification
Previously the only thing preventing default-unmanaged devices from
being auto-activated was luck and the fact that they didn't have any
available connections when in the UNMANAGED state.  That's no longer
true, so we must be more explicit about their behavior.

Furthermore it makes no sense to allow default-unmanaged devices
to set priv->autoconnect=TRUE since that is never supposed to
happen, so enforce that both in NM itself and if the change
request comes in over the D-Bus interface.

Lastly, internal priv->autoconnect=TRUE changes never emitted a
property change notification, meaning the NMPolicy would never
schedule an autoconnect check if the device's priv->autoconnect
was set to TRUE as a result of re-activating or waking from sleep.
2014-10-27 13:46:06 -05:00
Dan Williams
2bf7d6b5db core: loosen master device carrier check before IP configuration
Previously a master device would wait for a carrier before starting
IP configuration only for 'manual' connections, but that's not quite
broad enough.  We also want to allow SHARED methods to proceed
immediately since they are also effectively static/manual configuration.

Use the newly split out methods for checking whether a connection
requires a carrier or not to allow the SHARED method to proceed
for master devices without a carrier.

For example, this allows bridge configurations with tun/tap ports
to set up SHARED addressing before the tun/tap gets a carrier which
only happens when something opens the other side of the tun/tap
(like the VM or container).
2014-10-27 13:46:06 -05:00
Dan Williams
9e1d31763b trivial: move connection_requires_carrer() up
No code change, only move above a future user.
2014-10-27 13:46:06 -05:00
Dan Williams
37da01b517 core: refactor connection_requires_carrier() to split out method checking
The split out functions will be used next for master/slave decisions.
2014-10-27 13:46:06 -05:00
Dan Williams
98fe073fb9 core: use _nm_utils_string_in_list() instead of private function 2014-10-27 13:46:06 -05:00
Dan Williams
07e086dd0d core: shared connections don't require a carrier
They are effectively static connections since the address is manually
assigned, so they do not require a carrier.
2014-10-27 13:46:06 -05:00
Dan Williams
82d62c2c4e core: allow default unmanaged devices to have available connections when unmanaged
Default unmanaged devices become managed when the user explicitly activated
a connection on the device, but the user can't do that unless the device
has some available connections.  Fix things up so that default unmanaged
devices can have available connections.
2014-10-27 13:46:06 -05:00
Thomas Haller
7afdd9c979 dhclient: allow single hex digits in hexadecimal dhcp_client_id
When checking whether the dhcp-client-identifier is a hex string,
we expected pairs of hexadecimal digits separated by colon.
Relax this check to also allow single hex digits.

https://bugzilla.gnome.org/show_bug.cgi?id=737727

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-27 16:45:57 +01:00
Dan Winship
dc46e2c67b build: fix srcdir != builddir
callouts/tests/ needs -I$(top_builddir)/callouts to get
nmdbus-dispatcher.h
2014-10-24 14:41:19 -04:00
Lubomir Rintel
5f840abd7f contrib/rpm: Avoid unowned directories 2014-10-24 19:29:27 +02:00
Lubomir Rintel
4496b69e47 libnm: Ignore NoReply errors when NM has vanished from the bus
This fixes the /libnm/client-nm-running test failure when a race condition is hit:

test-nm-client:10350): libnm-WARNING **: updated_properties:
	error reading NMRemoteSettings properties:
	GDBus.Error:org.freedesktop.DBus.Error.NoReply:
	Message did not receive a reply (timeout by message bus)

What actually happens is that nm_running_changed_cb() calls GetAll() for a
NMRemoteSettings object when NM appears on the bus. If it disappears shortly
afterwards, another nm_running_changed_cb() is called which suppresses further
object updates, but the original GetAll() might not have finished yet and DBus
will generate a NoReply() response for it. We ought to ignore it.
2014-10-24 19:24:32 +02:00
Lubomir Rintel
b54030de22 core: Fall back to CLOCK_MONOTONIC if CLOCK_BOOTTIME unsupported
It was added fairly recently (2.6.39), this breaks run (and test run in mock)
on RHEL-6 with 2.6.32.
2014-10-24 19:24:32 +02:00
Lubomir Rintel
e9bfd0e29c tests: Don't run session-long dbus daemons for tests
They require a tty or X11 displays, thus are not suitable for headless runs
(such as in mock). Furthermore, they die with the tty or X11 session, which
is somehow late -- a lot of them may accumulate. Let's kill them right away.
2014-10-24 19:16:33 +02:00
Dan Williams
c459d5872f ibft: fix uninitialized variable 2014-10-23 13:52:10 -05:00