summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libnm-glib: add libnm compat defines to nm-vpn-plugin-ui-interface.hlr/vpn-compatDan Winship2015-07-162-0/+50
| | | | | | Add a bunch of compat defines to nm-vpn-plugin-ui-interface.h, to make it easier to compile the same code against libnm-glib's NMVpnPluginUiInterface and libnm's NMVpnEditorPlugin.
* libnm: handle illegal characters in nm_utils_ssid_to_utf8() (rh #1243078)David Shea2015-07-162-0/+30
| | | | | | | | | | | | g_convert_with_fallback() will fail if the SSID contains characters that are not legal in the source encoding, which, if $LANG is not set, will be ASCII. If this happens, replace all non-ASCII and non-printable characters with '?'. It is possible that nm_utils_ssid_to_utf8() will now return an empty string (e.g., the source string is actually big-endian UTF-16 and g_strcanon() stops on the first byte), but it will not return NULL. https://bugzilla.redhat.com/show_bug.cgi?id=1243078
* cli: fix a crash adding a slave connection with 'nmcli -a con add'Jiří Klimeš2015-07-151-2/+4
| | | | | | | | | | | | | | Valid types: [generic, 802-3-ethernet (ethernet), pppoe, 802-11-wireless (wifi), wimax, gsm, cdma, infiniband, adsl, bluetooth, vpn, 802-11-olpc-mesh (olpc-mesh), vlan, bond, team, bridge, bond-slave, team-slave, bridge-slave] Connection type: team-slave Interface name [*]: eth5 Master: nm-team Program received signal SIGSEGV, Segmentation fault. 0x000000000041ae6d in normalized_master_for_slave (connections=connections@entry=0x7fffec0019a0, master=<optimized out>, master@entry=0x73b470 "nm-team", type=type@entry=0x72f7c0 "team", out_type=out_type@entry=0x0) at connections.c:3218 3218 *out_type = con_type; Fixes: aa12bb353bca34be1bea0625c8e6e7715f24deb3
* cli: fix formating of "nmcli con add help" outputJiří Klimeš2015-07-151-2/+2
|
* cli: add 'slave-type' parameter for "nmcli con add" to bash completionJiří Klimeš2015-07-151-3/+9
| | | | Fixes: 1375d9c13ad6062f2c84089242f0dcfac1bd8e07
* settings: call dispatcher when setting hostname with systemdJiří Klimeš2015-07-151-0/+2
| | | | | | | | | Now that we set hostname with systemd, call dispatcher in nm-settings.c. gethostname() in nm-policy.c already sees the new hostname. Fixes: 6dc35e66d45e490482ac2909385099d77c26ed93 Fixes: 6c3d71c431ef63005f9005e68ff49b21b153ee9f Fixes:Beaker:NetworkManager_Test44_dispatcher_hostname
* build: fix comment for NM_MORE_LOGGINGLubomir Rintel2015-07-151-1/+1
| | | | Reported-by: Michael Biebl <biebl@debian.org>
* contrib/rpm: WEXT depends on enabled wifiDan Horák2015-07-141-5/+5
|
* logging: merge branch 'th/logging-sd-journal-bgo752136'Thomas Haller2015-07-1412-80/+334
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=752136
| * logging: refactor level conversion from switch() to @level_desc lookup-arrayThomas Haller2015-07-141-59/+29
| |
| * logging: add compile time default for logging.backend configurationThomas Haller2015-07-143-6/+28
| |
| * logging: add "journal-syslog-style" logging backend to log the old formatThomas Haller2015-07-142-8/+22
| | | | | | | | This mode logs the same message line as we do for "syslog".
| * logging: make use of journal configurableThomas Haller2015-07-147-6/+40
| |
| * logging: add native systemd-journald support to nm-loggingThomas Haller2015-07-142-16/+170
| |
| * build: detect systemd-journald supportThomas Haller2015-07-141-0/+25
| |
| * logging: factor our construction of logging message in _nm_log_impl()Thomas Haller2015-07-141-9/+17
| |
| * logging: refactor @syslog_opened variable to @log_backendThomas Haller2015-07-141-5/+12
| |
| * logging: allow calling nm_logging_syslog_openlog() only onceThomas Haller2015-07-141-8/+8
| |
| * logging: remove nm_logging_syslog_closelog()Thomas Haller2015-07-144-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove nm_logging_syslog_closelog(). The reasons are: - closelog() is optional according to the manual. - we called nm_logging_syslog_closelog() at the end of the main() function. But we have destructors running afterwards, so we were closing the log before logging the last line. Apparently that had no bad consequences either, so why was closelog() even useful? Also, it's hard to determine when we log the last line and only closelog() afterwards. - closelog() does not revert what openlog() did, this is ugly.
| * config: move debug command line option to NMConfigThomas Haller2015-07-143-4/+13
| | | | | | | | | | | | | | | | | | | | Whether NM runs in debug mode is also interesting to other components outside of "main.c". Expose global_opt.debug via a new nm_config_get_is_debug() function. Actually, we should move parsing of all command line options to NMConfig, as NMConfig is the central instance to provide such information.
| * config: add nm_config_data_get_value_cached() functionThomas Haller2015-07-142-0/+22
|/ | | | | | | nm_config_data_get_value() returns an allocated string. This is inconvenient for the caller. Add a utility function nm_config_data_get_value_cached() that caches the returned value. Of course, use with care as the returned string will be invalidated by each call to nm_config_data_get_value_cached().
* route-manager: merge branch 'th/route-full-sync'Thomas Haller2015-07-1419-165/+362
|\ | | | | | | | | | | | | | | Fix route manager not to delete externally added routes but only routes that were previously added by route manager. Also, add a test case and refactor the _exists() functions to have them more useful.
| * route-manager/test: add test for full-syncThomas Haller2015-07-141-0/+89
| |
| * test: add nmtst_platform_ip4_route() utilsThomas Haller2015-07-141-0/+32
| |
| * platform: replace addr/route exists() functions by get()Thomas Haller2015-07-148-98/+96
| | | | | | | | | | Rename exists() functions to get() and return the cached platform object.
| * route-manager: align trace logging statementThomas Haller2015-07-141-6/+6
| |
| * routes: fix race syncing routes by not doing full-syncThomas Haller2015-07-141-6/+20
| | | | | | | | | | | | | | | | | | | | In most cases, when syncing routes, we should only remove routes that were configured by us previously. Otherwise, there is a race that we can remove routes added externally. Now, when applying IP configuration for a device, only do a full-sync at the first time when we activate the device. Later on, only remove routes that were added by us.
| * routes/trival: add argument @routes_full_sync to IP config commitThomas Haller2015-07-147-10/+16
| | | | | | | | The argument is still unused, so no behavioral change yet.
| * route-manager: add argument to to only remove routes that were added by ↵Thomas Haller2015-07-145-46/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMRouteManager Add an argument @full_sync to the sync method of NMRouteManager. @full_sync was what we did up to now, meaning, we removed every route on the interface that was no on our internal list of known routes. Now with !@full_sync, only remove routes that were tracked previously. This means, we will only remove routes that were added by us previously. Don't make use of the new option yet. So there is no change of behavior yet.
| * route-manager/trivial: fix naming of local variableThomas Haller2015-07-141-4/+4
|/
* vpn-plugin-old,dispatcher: cast unchecked g_variant_lookup() calls to voidLubomir Rintel2015-07-142-7/+7
| | | | | | This is done to silence coverity. In the dispatcher the existence of the key is checked before and we're fine with leaving the value untouched in the vpn-plugin-old.
* linux-platform: correct the lifetime conditionalLubomir Rintel2015-07-141-2/+2
| | | | | Coverity detected that it was always-true: src/platform/nm-linux-platform.c:4035: dead_error_line: Execution cannot reach the expression "preferred != 0U" inside this statement: "if (lifetime != 0U || lifet...".
* config: fix a potential NULL dereferenceLubomir Rintel2015-07-141-1/+1
| | | | | Coverity: src/nm-config.c:598: var_deref_op: Dereferencing null pointer "groups".
* vpn: send firewall zone to firewalld also for VPN connections (rh #1065948)Jiří Klimeš2015-07-141-7/+83
| | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1065948 https://bugzilla.redhat.com/show_bug.cgi?id=1238124
* platform: don't assert there's no parent-parent loopsLubomir Rintel2015-07-141-3/+3
| | | | http://www.spinics.net/lists/netdev/msg314907.html
* vpn: merge branch 'th/vpn-route-bgo752225'Thomas Haller2015-07-132-15/+39
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=752225
| * vpn: fix creating config for non-tunnel based VPN connectionsThomas Haller2015-07-131-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #0 0x00007ffff4200a98 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55 #1 0x00007ffff420272a in __GI_abort () at abort.c:89 #2 0x00007ffff4a372a5 in g_assertion_message (domain=domain@entry=0x5555557a0511 "NetworkManager", file=file@entry=0x5555557b201c "nm-ip4-config.c", line=line@entry=1458, func=func@entry=0x5555557b221b "nm_ip4_config_add_route", message=message@entry=0x555555b96a00 "assertion failed: (priv->ifindex)") at gtestutils.c:2356 #3 0x00007ffff4a3733a in g_assertion_message_expr (domain=0x5555557a0511 "NetworkManager", file=0x5555557b201c "nm-ip4-config.c", line=1458, func=0x5555557b221b "nm_ip4_config_add_route", expr=<optimized out>) at gtestutils.c:2371 #4 0x000055555567f414 in nm_ip4_config_add_route (config=0x555555c27f80 [NMIP4Config], new=0x7fffffffd378) at nm-ip4-config.c:1458 #5 0x000055555576b6d6 in add_ip4_vpn_gateway_route (config=0x555555c27f80 [NMIP4Config], parent_device=0x555555afeb80 [NMDeviceEthernet], vpn_gw=4240082129) at vpn-manager/nm-vpn-connection.c:522 #6 0x000055555576b3c3 in apply_parent_device_config (connection=0x7fffdc01a300 [NMVpnConnection]) at vpn-manager/nm-vpn-connection.c:910 #7 0x000055555576b197 in nm_vpn_connection_apply_config (connection=0x7fffdc01a300 [NMVpnConnection]) at vpn-manager/nm-vpn-connection.c:945 #8 0x0000555555769ada in nm_vpn_connection_config_maybe_complete (connection=0x7fffdc01a300 [NMVpnConnection], success=1) at vpn-manager/nm-vpn-connection.c:981 #9 0x000055555576c35f in nm_vpn_connection_ip4_config_get (self=0x7fffdc01a300 [NMVpnConnection], dict=0x555555c10150) at vpn-manager/nm-vpn-connection.c:1285 #10 0x0000555555766e2c in ip4_config_cb (proxy=0x555555acedd0 [GDBusProxy], dict=0x555555c10150, user_data=0x7fffdc01a300) at vpn-manager/nm-vpn-connection.c:1643 #11 0x00007ffff27f2db0 in ffi_call_unix64 () at ../src/x86/unix64.S:76 #12 0x00007ffff27f2818 in ffi_call (cif=cif@entry=0x7fffffffd870, fn=<optimized out>, rvalue=0x7fffffffd7d0, avalue=avalue@entry=0x7fffffffd770) at ../src/x86/ffi64.c:525 #13 0x00007ffff4d114f9 in g_cclosure_marshal_generic (closure=0x555555b67f20, return_gvalue=0x0, n_param_values=<optimized out>, param_values=0x555555a77220, invocation_hint=<optimized out>, marshal_data=0x0) at gclosure.c:1448 #14 0x00005555556c824d in dbus_signal_meta_marshal (closure=0x555555b67f20, return_value=0x0, n_param_values=4, param_values=0x7fffffffdb50, invocation_hint=0x7fffffffdad0, marshal_data=0x555555b8aa60) at ../libnm-core/nm-dbus-utils.c:95 #18 0x00007ffff4d2b29f in <emit signal ??? on instance 0x555555acedd0 [GDBusProxy]> (instance=instance@entry=0x555555acedd0, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3361 #15 0x00007ffff4d10cd5 in g_closure_invoke (closure=0x555555b67f20, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffdb50, invocation_hint=invocation_hint@entry=0x7fffffffdad0) at gclosure.c:768 #16 0x00007ffff4d22539 in signal_emit_unlocked_R (node=node@entry=0x555555a46290, detail=detail@entry=0, instance=instance@entry=0x555555acedd0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffdb50) at gsignal.c:3549 #17 0x00007ffff4d2aef0 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffdd50) at gsignal.c:3305 #19 0x00007ffff502ebac in on_signal_received (connection=<optimized out>, sender_name=0x7fffe00063e0 ":1.541", object_path=<optimized out>, interface_name=<optimized out>, signal_name=0x7fffe0016f80 "Ip4Config", parameters=0x555555c22330, user_data=0x7fffdc00e850) at gdbusproxy.c:917 #20 0x00007ffff501e8b4 in emit_signal_instance_in_idle_cb (data=0x7fffe0016a60) at gdbusconnection.c:3753 #21 0x00007ffff4a10a8a in g_main_context_dispatch (context=0x555555a23360) at gmain.c:3122 #22 0x00007ffff4a10a8a in g_main_context_dispatch (context=context@entry=0x555555a23360) at gmain.c:3737 #23 0x00007ffff4a10e20 in g_main_context_iterate (context=0x555555a23360, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808 #24 0x00007ffff4a11142 in g_main_loop_run (loop=0x555555a23420) at gmain.c:4002 #25 0x00005555555b7e7b in main (argc=1, argv=0x7fffffffe3b8) at main.c:484 https://bugzilla.gnome.org/show_bug.cgi?id=752225
| * vpn: allow overwriting default gateway by connection configurationThomas Haller2015-07-132-3/+6
| | | | | | | | | | | | It is wrong to only consider internal_gateway of the VPN connection. Instead, we must first set the gateway of NMIP4Config and then overwrite it with the connection settings.
| * vpn: fix overwriting gateway of parent device for non-tunnel based VPNsThomas Haller2015-07-131-2/+9
| | | | | | | | | | | | | | | | | | For non-tunnel based VPNs (openswan, libreswan), we must clear the gateway setting. The default route is managed by NMDefaultRouteManager, and we must not overwrite the gateway of the parent device. This fixes a bug if the VPN connection specifies a gateway, it would have overwritten the gateway of the underlying device.
| * vpn: don't set the gateway of VPN's IP config to the external gatewayThomas Haller2015-07-131-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The gateway property of NMIP4Config/IP6Config determines the next hop for the default route. That is different from the @external_gw property of the VPN which is the address of the world-reachable VPN gateway. It is wrong to set the gateway of the VPN's IP config to the external gateway. This causes ip4_config_merge_and_apply() to overwrite the gateway of the underlying device. Instead, NMDefaultRouteManger gets the gateway directly from the VPN connection by quering nm_vpn_connection_get_ip4_internal_gateway().
| * default-route-manager: fix handling for absent default routes for VPNThomas Haller2015-07-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a VPN has no default route, it is wrong to enforce the absence of a default route on that device. Instead, if there is no default route, NMDefaultRouteManager should just forget about the route. This is especially important, because for VPN types like openswan there is no distinct tunnel interface. Instead, it shares the ifindex with the parent-device. Note that devices usually only enforce their default-route for a short time and afterwards switch to non-synced. If that happens and there is a VPN that enforces the absense of the default route on that device, we end up deleting the default route.
| * default-route-manager: don't add entries with (!synced && never_default)Thomas Haller2015-07-131-0/+7
|/ | | | | Entries with (!synced && never_default) make no sense. Don't add them to the list of tracked entires.
* cli: fix usage output for `nmcli connection add` removing duplicate "save"Thomas Haller2015-07-131-1/+0
| | | | Fixes: 1375d9c13ad6062f2c84089242f0dcfac1bd8e07
* merge: branch 'lr/cli-add-master'Lubomir Rintel2015-07-124-243/+285
|\ | | | | | | | | | | Make it possible to specify master connection/device for any connection profile https://bugzilla.gnome.org/show_bug.cgi?id=748302
| * cli: add "nmcli c add master" to bash-completionlr/cli-add-masterLubomir Rintel2015-07-121-22/+4
| | | | | | | | Remove the discouraged forms.
| * cli: add master option to "nmcli c add"Lubomir Rintel2015-07-123-22/+63
| |
| * cli: discover slave type for a connection with a masterLubomir Rintel2015-07-121-11/+33
| | | | | | | | | | | | | | | | | | Rename verify_master_for_slave(), since it does a lot more than just verifying the master setting. Make the type check optional and return the type of the connection that matched. This makes it possible to omit setting the slave type on a command line and still get the slave type right.
| * cli: remove an extraneous _strip_master_prefix() callLubomir Rintel2015-07-121-1/+1
| | | | | | | | verify_master_for_slave() already ensures the returned string has no prefix.
| * cli: process slave parameters after the rest of the settings are set upLubomir Rintel2015-07-121-193/+190
|/ | | | | | | | | This separates setup of the master & slave type and addition of the wired settings for "bond-slave", "bridge-slave" and "team-slave" connection types from processing of slave type specific options. A follow-up commit will make it possible to specify master (and slave type) for any connection, not relying on "-slave" types.
* merge branch 'th/misc-bgo752087'Thomas Haller2015-07-1245-396/+480
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=752087