NetworkManager/src
Thomas Haller 72c36bd6db device/tun: fix reloading tun properties
Before the device is setup, we call nm_platform_tun_get_properties() without
a valid ifindex. That triggered an assertion [1].

Thereby, change nm_platform_tun_get_properties() to effectively clear
the tun properties when we are unable to fetch them. Also, never modify
the tun-mode of NMDeviceTun.

[1]
    #0  0x00007f0a4173e81b in g_logv (breakpoint=1) at gmessages.c:324
    #1  0x00007f0a4173e81b in g_logv (log_domain=0x561e9264ccf6 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7ffd71a0d4d0) at gmessages.c:1081
    #2  0x00007f0a4173e98f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1119
    #3  0x0000561e9241ecec in nm_platform_tun_get_properties (self=0x561e9354ba70 [NMLinuxPlatform], ifindex=0, props=0x7ffd71a0d650) at platform/nm-platform.c:2081
    #4  0x0000561e923aad9c in reload_tun_properties (self=0x561e937fb080 [NMDeviceTun]) at devices/nm-device-tun.c:68
    #5  0x0000561e923aa795 in realize (device=0x561e937fb080 [NMDeviceTun], plink=0x7ffd71a0d818, error=0x7ffd71a0d798) at devices/nm-device-tun.c:225
    #6  0x0000561e923bdc06 in nm_device_realize (self=0x561e937fb080 [NMDeviceTun], plink=0x7ffd71a0d818, out_compatible=0x7ffd71a0d77c, error=0x7ffd71a0d798) at devices/nm-device.c:1713
    #7  0x0000561e924ad995 in platform_link_added (self=0x561e9356e230 [NMManager], ifindex=33, plink=0x7ffd71a0d818) at nm-manager.c:1947
    #8  0x0000561e924ad717 in _platform_link_cb_idle (data=0x561e937eb940) at nm-manager.c:2029
    #9  0x00007f0a41737e3a in g_main_context_dispatch (context=0x561e93547530) at gmain.c:3154
    #10 0x00007f0a41737e3a in g_main_context_dispatch (context=context@entry=0x561e93547530) at gmain.c:3769
    #11 0x00007f0a417381d0 in g_main_context_iterate (context=0x561e93547530, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3840
    #12 0x00007f0a417384f2 in g_main_loop_run (loop=0x561e935475f0) at gmain.c:4034
    #13 0x0000561e923ba3f3 in main (argc=1, argv=0x7ffd71a0dc68) at main.c:488

Fixes: 4dbaac4ba2
2015-12-07 11:32:12 +01:00
..
devices device/tun: fix reloading tun properties 2015-12-07 11:32:12 +01:00
dhcp-manager dhcp: lifetimes are unsigned integers, use %u printf specifier (rh #1268911) 2015-12-03 15:25:54 +01:00
dns-manager logging: swap names of logging macros _LOGT() and _LOGt() 2015-11-06 14:16:41 +01:00
dnsmasq-manager platform: properly handle IPv4 peer-addresses 2015-11-02 13:57:01 +01:00
platform platform: use NM_UTILS_FLAGS2STR_DEFINE() macro 2015-12-04 16:31:15 +01:00
ppp-manager ppp-manager: set 'export_on_construction' flag 2015-11-26 23:11:29 +01:00
rdisc rdisc/tests: initialize iid passed to nm_rdisc_set_iid() 2015-11-03 22:25:19 +01:00
settings core: add "real" NMDevice property 2015-12-04 12:15:12 +01:00
supplicant-manager wifi: propagte errors from supplicant-config to caller 2015-11-19 13:45:14 +01:00
systemd Revert "systemd: fix potential memory leaks" 2015-11-28 22:53:31 +01:00
tests core: strip trailing dot from domain search list 2015-12-05 09:55:03 +01:00
vpn-manager core: explicitly unexport objects when we're done with them 2015-11-10 18:12:12 +01:00
main-utils.c core: don't handle SIGUSR1 and SIGUSR2 signals for pre 2.36.0 glib 2015-11-25 10:54:18 +01:00
main-utils.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
main.c main: add argument --print-config to NetworkManager 2015-11-22 13:40:32 +01:00
Makefile.am device: remove NMDeviceGre 2015-12-01 17:39:41 +01:00
NetworkManagerUtils.c utils: save duplicate lookup of path in nm_utils_g_value_set_object_path_array() 2015-12-04 18:28:00 +01:00
NetworkManagerUtils.h utils: add NM_UTILS_FLAGS2STR_DEFINE() macro 2015-12-04 16:28:43 +01:00
nm-activation-request.c core: allow multiple devices with the same interface name 2015-12-04 12:16:41 +01:00
nm-activation-request.h core: separate active and applied connection 2015-09-18 17:32:11 +02:00
nm-active-connection.c core: allow multiple devices with the same interface name 2015-12-04 12:16:41 +01:00
nm-active-connection.h core: separate active and applied connection 2015-09-18 17:32:11 +02:00
nm-audit-manager.c core: separate active and applied connection 2015-09-18 17:32:11 +02:00
nm-audit-manager.h core: separate active and applied connection 2015-09-18 17:32:11 +02:00
nm-auth-manager.c core: use NM_UTILS_ERROR_CANCELLED_DISPOSING error reason 2015-09-25 10:34:02 +02:00
nm-auth-manager.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-auth-subject.c core: final gdbus porting 2015-08-10 09:41:26 -04:00
nm-auth-subject.h core: final gdbus porting 2015-08-10 09:41:26 -04:00
nm-auth-utils.c auth-utils: some refactoring in nm-auth-utils.c 2015-09-18 14:31:31 +02:00
nm-auth-utils.h manager: export DNS global configuration D-Bus property 2015-10-01 09:05:08 +02:00
nm-bus-manager.c exported-object: add support for DBus ObjectManager interface 2015-11-18 15:15:05 +01:00
nm-bus-manager.h exported-object: add support for DBus ObjectManager interface 2015-11-18 15:15:05 +01:00
nm-config-data.c main: add argument --print-config to NetworkManager 2015-11-22 13:40:32 +01:00
nm-config-data.h main: add argument --print-config to NetworkManager 2015-11-22 13:40:32 +01:00
nm-config.c main: add argument --print-config to NetworkManager 2015-11-22 13:40:32 +01:00
nm-config.h keyfile: make the keyfile location configurable 2015-10-14 20:23:38 +02:00
nm-connection-provider.c core: fix interface type names 2015-09-10 13:43:47 -04:00
nm-connection-provider.h core: fix interface type names 2015-09-10 13:43:47 -04:00
nm-connectivity.c logging: declare default logging macros in "nm-logging.h" 2015-08-20 11:15:13 +02:00
nm-connectivity.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-dcb.c all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-dcb.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-default-route-manager.c platform: remove NMPlatformReason enum 2015-11-27 15:17:44 +01:00
nm-default-route-manager.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-dhcp4-config.c core: fix wrongly exporting object before instance is fully constructed 2015-11-10 18:12:12 +01:00
nm-dhcp4-config.h core: port NMDhcp4Config/NMDhcp6Config to GVariant 2015-07-24 13:25:47 -04:00
nm-dhcp6-config.c core: fix wrongly exporting object before instance is fully constructed 2015-11-10 18:12:12 +01:00
nm-dhcp6-config.h core: port NMDhcp4Config/NMDhcp6Config to GVariant 2015-07-24 13:25:47 -04:00
nm-dispatcher.c dispatcher: don't abort when VPN connections have no IPv4 2015-11-13 16:13:40 +01:00
nm-dispatcher.h core: separate active and applied connection 2015-09-18 17:32:11 +02:00
nm-exported-object.c exported-object: add support for DBus ObjectManager interface 2015-11-18 15:15:05 +01:00
nm-exported-object.h exported-object: add support for DBus ObjectManager interface 2015-11-18 15:15:05 +01:00
nm-firewall-manager.c firewall-manager: handle bus connection failure 2015-09-30 16:02:48 +02:00
nm-firewall-manager.h firewall: always take a reference to NMFirewallManager during asynchronous operations 2015-09-25 10:34:03 +02:00
nm-iface-helper.c platform: remove NMPlatformReason enum 2015-11-27 15:17:44 +01:00
nm-ip4-config.c core: strip trailing dot from domain search list 2015-12-05 09:55:03 +01:00
nm-ip4-config.h ip4-config: let the IPv4 device route depend on the peer-address 2015-11-02 13:57:01 +01:00
nm-ip6-config.c core: strip trailing dot from domain search list 2015-12-05 09:55:03 +01:00
nm-ip6-config.h core: add @merge_flags argument to nm_ip4_config_merge() and nm_ip6_config_merge() 2015-08-06 17:52:55 +02:00
nm-logging.c logging: properly use current domains when setting logging 2015-10-09 14:58:03 +02:00
nm-logging.h logging: swap names of logging macros _LOGT() and _LOGt() 2015-11-06 14:16:41 +01:00
nm-manager.c core: subscribe recheck_assume_connection() early when adding device 2015-12-04 17:36:16 +01:00
nm-manager.h api/manager: add GetAllDevices() method and AllDevices property 2015-12-04 12:16:41 +01:00
nm-multi-index.c all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-multi-index.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-policy.c policy: add a friendly warning 2015-12-04 18:03:30 +01:00
nm-policy.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-rfkill-manager.c manager: remove WiMAX rfkill flag from NMManger 2015-08-13 10:06:42 +02:00
nm-rfkill-manager.h core: skip generating gtype for rfkill enums 2015-08-19 13:49:33 +02:00
nm-route-manager.c platform: remove NMPlatformReason enum 2015-11-27 15:17:44 +01:00
nm-route-manager.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-session-monitor.c session-monitor: explicitly use singleton instance 2015-08-13 10:06:42 +02:00
nm-session-monitor.h session-monitor: explicitly use singleton instance 2015-08-13 10:06:42 +02:00
nm-sleep-monitor-systemd.c sleep-monitor: add support for ConsoleKit2 inhibit 2015-08-07 11:45:57 +02:00
nm-sleep-monitor-upower.c all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-sleep-monitor.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-types.h core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
org.freedesktop.NetworkManager.conf libnm: avoid loosing signals 2015-12-01 14:51:13 +01:00