NetworkManager/src/devices
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
..
adsl platform: remove NMPlatformReason enum 2015-11-27 15:17:44 +01:00
bluetooth device: expose nm_device_set_autoconnect() function 2015-12-04 15:46:04 +01:00
team device: cleanup handling master/slave relationships in NMDevice 2015-12-05 19:34:06 +01:00
tests lldp: add test case 2015-11-10 14:25:05 +01:00
wifi wifi: fix supplicant_connection_timeout_cb() using settings-connection 2015-12-05 19:34:06 +01:00
wwan device: expose nm_device_set_autoconnect() function 2015-12-04 15:46:04 +01:00
Makefile.am lldp: add test case 2015-11-10 14:25:05 +01:00
nm-device-bond.c device: cleanup handling master/slave relationships in NMDevice 2015-12-05 19:34:06 +01:00
nm-device-bond.h device: implement slave property in parent device class 2015-12-05 19:34:06 +01:00
nm-device-bridge.c device: cleanup handling master/slave relationships in NMDevice 2015-12-05 19:34:06 +01:00
nm-device-bridge.h device: implement slave property in parent device class 2015-12-05 19:34:06 +01:00
nm-device-ethernet-utils.c all: drop includes to <glib/gi18n.h> for "nm-default.h" 2015-08-05 15:35:51 +02:00
nm-device-ethernet-utils.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-device-ethernet.c core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
nm-device-ethernet.h device: export S390Subchannels property on Ethernet device 2015-09-29 09:30:01 +02:00
nm-device-factory.c core: fix interface type names 2015-09-10 13:43:47 -04:00
nm-device-factory.h core: fix interface type names 2015-09-10 13:43:47 -04:00
nm-device-generic.c core/trivial: rename functions 2015-12-04 15:46:04 +01:00
nm-device-generic.h core: split device creation and device setup (bgo #737458) 2015-07-31 14:06:09 -05:00
nm-device-infiniband.c core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
nm-device-infiniband.h all: rename nm-glib-compat.h to nm-glib.h, use everywhere 2015-07-24 13:25:47 -04:00
nm-device-ip-tunnel.c core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
nm-device-ip-tunnel.h device/ip-tunnel: add support for IP6TNL tunnels 2015-12-01 17:39:41 +01:00
nm-device-logging.h logging: declare default logging macros in "nm-logging.h" 2015-08-20 11:15:13 +02:00
nm-device-macvlan.c core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
nm-device-macvlan.h all: rename nm-glib-compat.h to nm-glib.h, use everywhere 2015-07-24 13:25:47 -04:00
nm-device-private.h core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
nm-device-tun.c device/tun: fix reloading tun properties 2015-12-07 11:32:12 +01:00
nm-device-tun.h device/tun: support device creation 2015-11-25 11:39:57 +01:00
nm-device-veth.c core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
nm-device-veth.h all: rename nm-glib-compat.h to nm-glib.h, use everywhere 2015-07-24 13:25:47 -04:00
nm-device-vlan.c core/trivial: rename functions 2015-12-04 15:46:04 +01:00
nm-device-vlan.h core: split device creation and device setup (bgo #737458) 2015-07-31 14:06:09 -05:00
nm-device-vxlan.c core: ensure platform links are compatible with the NMDevice 2015-12-04 12:16:41 +01:00
nm-device-vxlan.h all: rename nm-glib-compat.h to nm-glib.h, use everywhere 2015-07-24 13:25:47 -04:00
nm-device.c device: cleanup handling master/slave relationships in NMDevice 2015-12-05 19:34:06 +01:00
nm-device.h device: implement slave property in parent device class 2015-12-05 19:34:06 +01:00
nm-lldp-listener.c lldp: decouple NMLldpListener from platform 2015-11-10 14:17:42 +01:00
nm-lldp-listener.h lldp: decouple NMLldpListener from platform 2015-11-10 14:17:42 +01:00