IPv6 in network-manager-openvpn



Hello,

A few weeks ago I ran into a bug in NetworkManager: even though OpenVPN now supports IPv6 in tunnels, the OpenVPN plugin of NetworkManager doesn't support it. I found bug 682620 (https://bugzilla.gnome.org/show_bug.cgi?id=682620) and I've implemented some of the missing features with the help of network-manager-openconnect commits (basically the IPv6 payload part, not the IPv6 endpoint one). My patches are attached to this email. Can someone review them and tell me what may be wrong with them? As I'm new with NetworkManager, I think there must be some mistakes in my code.

The patches are working well in my testing environment with NetworkManager 0.9.8 but with the development revision I've got few issues such as https://bugzilla.gnome.org/show_bug.cgi?id=706286. Now NM crashes on a segmentation fault at http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/nm-policy.c#n788 as nm_vpn_connection_get_ip6_internal_gateway returns NULL for my VPN (there are IPv6 unique local addresses on my OpenVPN server, without routing) so there is still work to be done before further testing. I'll certainly fill a bug report tomorrow but right now I can provide some logs and a coredump backtrace, after this message.

Thanks,

Nicolas


/var/log/daemon.log:

NetworkManager[30420]: <info> (tun0): carrier is OFF 
nm-openvpn[30512]: /usr/lib/networkmanager/nm-openvpn-service-openvpn-helper tun0 1500 1544 10.55.62.6 10.55.62.5 init 
NetworkManager[30420]: <info> (tun0): new Tun device (driver: 'unknown' ifindex: 5) 
NetworkManager[30420]: <info> (tun0): exported as /org/freedesktop/NetworkManager/Devices/3 
NetworkManager[30420]: <info> VPN connection 'Iosenag' (IP Config Get) reply received. 
NetworkManager[30420]: <info> VPN connection 'Iosenag' (IP4 Config Get) reply received. 
NetworkManager[30420]: <info> VPN connection 'Iosenag' (IP6 Config Get) reply received. 
NetworkManager[30420]: <info> VPN Gateway: 31.7.184.34 
NetworkManager[30420]: <info> Tunnel Device: tun0 
NetworkManager[30420]: <info> IPv4 configuration: 
NetworkManager[30420]: <info>   Internal Gateway: 10.55.62.5 
NetworkManager[30420]: <info>   Internal Address: 10.55.62.6 
NetworkManager[30420]: <info>   Internal Prefix: 32 
NetworkManager[30420]: <info>   Internal Point-to-Point Address: 10.55.62.5 
nm-openvpn[30512]: Initialization Sequence Completed 
NetworkManager[30420]: <info>   Maximum Segment Size (MSS): 0 
NetworkManager[30420]: <info>   Static Route: 10.55.62.1/32   Next Hop: 10.55.62.1 
NetworkManager[30420]: <info>   Forbid Default Route: no 
NetworkManager[30420]: <info>   Internal DNS: 10.55.62.1 
NetworkManager[30420]: <info>   Internal DNS: 208.67.222.222 
NetworkManager[30420]: <info>   DNS Domain: '(none)' 
NetworkManager[30420]: <info> IPv6 configuration: 
NetworkManager[30420]: <info>   Internal Address: fd10:0:55:62::1000 
NetworkManager[30420]: <info>   Internal Prefix: 64 
NetworkManager[30420]: <info>   Internal Point-to-Point Address: fd10:0:55:62::1 
NetworkManager[30420]: <info>   Maximum Segment Size (MSS): 0 
NetworkManager[30420]: <info>   Forbid Default Route: no 
NetworkManager[30420]: <info>   DNS Domain: '(none)' 
NetworkManager[30420]: <info> (tun0): link connected 
NetworkManager[30420]: <error> [1376927563.222516] [platform/nm-linux-platform.c:1018] add_object(): Netlink error: Unspecific failure 
NetworkManager[30420]: <info> VPN connection 'Iosenag' (IP Config Get) complete. 
NetworkManager[30420]: <error> [1376927563.225071] [platform/nm-linux-platform.c:1018] add_object(): Netlink error: Unspecific failure 
NetworkManager[30420]: <error> [1376927563.225281] [platform/nm-linux-platform.c:1018] add_object(): Netlink error: Unspecific failure 
NetworkManager[30420]: <error> [1376927563.225294] [nm-policy.c:617] update_ip4_routing(): Failed to set default route. 
NetworkManager[30420]: <info> Policy set 'Iosenag' (tun0) as default for IPv4 routing and DNS. 
systemd[1]: NetworkManager.service: main process exited, code=dumped, status=11/SEGV 
systemd[1]: Unit NetworkManager.service entered failed state. 


Coredump backtrace (using "systemd-coredumpctl gdb 30420"):
TIME                                         PID   UID   GID SIG EXE
            lun. 2013-08-19 17:52:43 CEST  30420     0     0  11 /usr/bin/NetworkManager
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/NetworkManager...done.
[New LWP 30420]
[New LWP 30421]
[New LWP 30510]
[New LWP 30422]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x6fb5d0c90000
Core was generated by `/usr/sbin/NetworkManager --no-daemon'.
Program terminated with signal 11, Segmentation fault.
#0  0x000000000047fb9b in update_ip6_routing (policy=policy entry=0x224a540, force_update=force_update entry=1) at nm-policy.c:790
790 struct in6_addr int_gw = *nm_vpn_connection_get_ip6_internal_gateway (vpn);
(gdb) bt
#0  0x000000000047fb9b in update_ip6_routing (policy=policy entry=0x224a540, force_update=force_update entry=1) at nm-policy.c:790
#1  0x00000000004806fd in update_routing_and_dns (policy=0x224a540, force_update=1) at nm-policy.c:833
#2  0x0000000000480838 in vpn_connection_activated (vpn=0x2245160, policy=0x224a540) at nm-policy.c:1591
#3  active_connection_state_changed (active=<optimized out>, pspec=<optimized out>, policy=0x224a540) at nm-policy.c:1640
#4  0x00006fb5ce900458 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#5  0x00006fb5ce91140d in ?? () from /usr/lib/libgobject-2.0.so.0
#6  0x00006fb5ce919219 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#7  0x00006fb5ce919462 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#8  0x00006fb5ce9047d5 in ?? () from /usr/lib/libgobject-2.0.so.0
#9  0x00006fb5ce9060cb in g_object_notify () from /usr/lib/libgobject-2.0.so.0
#10 0x0000000000469910 in nm_active_connection_set_state (self=0x2245160, new_state=NM_ACTIVE_CONNECTION_STATE_ACTIVATED) at nm-active-connection.c:103
#11 0x00000000004acf0b in nm_vpn_connection_set_vpn_state (connection=connection entry=0x2245160, vpn_state=vpn_state entry=NM_VPN_CONNECTION_STATE_ACTIVATED, 
    reason=reason entry=NM_VPN_CONNECTION_STATE_REASON_NONE) at vpn-manager/nm-vpn-connection.c:212
#12 0x00000000004ade08 in nm_vpn_connection_apply_config (connection=0x2245160) at vpn-manager/nm-vpn-connection.c:677
#13 nm_vpn_connection_config_maybe_complete (connection=connection entry=0x2245160, success=success entry=1) at vpn-manager/nm-vpn-connection.c:710
#14 0x00000000004aed7d in nm_vpn_connection_ip6_config_get (proxy=<optimized out>, config_hash=0x6fb5c4004180, user_data=<optimized out>) at vpn-manager/nm-vpn-connection.c:1106
#15 0x00006fb5d05f2124 in ?? () from /usr/lib/libdbus-glib-1.so.2
#16 0x00006fb5ce900458 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#17 0x00006fb5ce91140d in ?? () from /usr/lib/libgobject-2.0.so.0
#18 0x00006fb5ce919219 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#19 0x00006fb5ce919462 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#20 0x00006fb5d05f278a in ?? () from /usr/lib/libdbus-glib-1.so.2
#21 0x00006fb5d03aa0a6 in dbus_connection_dispatch () from /usr/lib/libdbus-1.so.3
#22 0x00006fb5d05ebe05 in ?? () from /usr/lib/libdbus-glib-1.so.2
#23 0x00006fb5ce435da6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#24 0x00006fb5ce4360f8 in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00006fb5ce4364fa in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#26 0x0000000000429d7c in main (argc=1, argv=0x7d40227dfe18) at main.c:628

Attachment: 0001-service-pass-IPv6-related-information-to-NM.patch
Description: Binary data

Attachment: 0002-properties-expose-IPv6-capability-to-the-UI.patch
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]