After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701819 - dispatcher scripts get bogus IPv6 addresses
dispatcher scripts get bogus IPv6 addresses
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-06-07 21:22 UTC by David Woodhouse
Modified: 2014-03-14 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Woodhouse 2013-06-07 21:22:40 UTC
nmcli shows sane IPv6 information for my interfaces.

IPv6 information isn't present when the dispatcher script is run after the physical Ethernet interface comes up, because RA hasn't happened yet.

However, for some reason the IP information of the underlying device is all present when the dispatcher script is run for a VPN connection.

But when that happens, the IPv6 information is bogus:


IP6_ADDRESS_0='6474:dc0c:f17f::/64 7874:dc0c:f17f:0:3634:3734:3a64:6330'
IP6_NUM_ADDRESSES=1


# nmcli c status uuid 055a615c-04a2-40e2-b26b-fa957f9eefaa | grep IP6
IP6.ADDRESS[1]:                         ip = 2001:8b0:10b:1:225:64ff:fee8:e9df/64, gw = fe80::230:18ff:fea4:c9c2
IP6.ADDRESS[2]:                         ip = fe80::225:64ff:fee8:e9df/64, gw = fe80::230:18ff:fea4:c9c2
IP6.DNS[1]:                             2001:8b0:10b:1:21d:7dff:fe04:dbe2
Comment 1 Milan Crha 2013-07-04 12:28:25 UTC
Maybe related to bug #700414
Comment 2 Pavel Simerda 2013-08-13 16:31:57 UTC
(In reply to comment #1)
> Maybe related to bug #700414

I don't see how bogus data exposed by NetworkManager could be related to that one.
Comment 3 Pavel Simerda 2013-08-13 19:25:51 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Maybe related to bug #700414
> 
> I don't see how bogus data exposed by NetworkManager could be related to that
> one.

I guess it was bug 689741.
Comment 4 Pavel Simerda 2013-10-01 19:18:49 UTC
Is it reproducible with the current git master or latest 0.9 bugfix release?
Comment 5 Pavel Simerda 2014-02-03 10:56:23 UTC
Switching from NEEDINFO to INCOMPLETE after a couple of months of inactivity. Please reopen if you can provide the requested information.
Comment 6 David Woodhouse 2014-02-03 12:09:22 UTC
Still broken with 0.9.9.0-28 on Fedora 20. 

A little confused as to why it had to be *me* who tested this. Surely people working on NetworkManager aren't stuck on the 20th century without IPv6 connectivity? How can you work on NM without having IPv6?

** Message: ------------ Action ID 0x7f99692643a0 'up' Interface wlp3s0 Environment ------------
...
** Message:   IP6_NUM_ROUTES=1
** Message:   IP6_ROUTE_0=9472:2669:997f::/128 a872:2669:997f:0:3934:3732:3a32:3636 0
** Message:   IP6_NUM_ADDRESSES=1
** Message:   IP6_ADDRESS_0=f471:2669:997f::/64 872:2669:997f:0:6634:3731:3a32:3636
Comment 7 Pavel Simerda 2014-02-04 13:03:21 UTC
(In reply to comment #6)
> Still broken with 0.9.9.0-28 on Fedora 20.

Thank you for reopening, then.
Comment 8 Thomas Haller 2014-02-26 21:37:12 UTC
I cannot reproduce this. Could an affected user please attach its connection profile? 


E.g. obtainable via

nmcli connection show configured <id>

(
or newer nmcli:
nmcli connection show <id>
)


Please also state the versions of NM you are using.
Comment 9 Tore Anderson 2014-02-27 17:38:41 UTC
Hi Thomas, as requested here's one example:

dispatcher script sees:

$ sudo grep dumpenv /var/log/messages
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: cmdline: enp0s26u1u5i6 up
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_REQUESTED_DHCP6_CLIENT_ID=1
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DEVICE_IP_IFACE=enp0s26u1u5i6
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: CONNECTION_UUID=879de7eb-503b-409e-a5bf-ca3af0ad047b
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DEVICE_IFACE=enp0s26u1u5i6
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_DHCP6_CLIENT_ID=0:1:0:1:1a:8b:f7:5d:2c:59:e5:b9:d3:9e
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: IP6_NUM_ADDRESSES=2
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: IP6_NAMESERVERS=2a00:e18:0:3::6
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_DHCP6_SERVER_ID=0:1:0:1:0:0:10:5c:0:15:e0:ec:1:1
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: CONNECTION_ID=WWAN
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: PWD=/
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: IP4_NUM_ROUTES=0
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_REQUESTED_DHCP6_SERVER_ID=1
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: SHLVL=1
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_DHCP6_STATUS_CODE=success
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_REQUESTED_DHCP6_NAME_SERVERS=1
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_DHCP6_NAME_SERVERS=2a00:e18:0:3::6
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: IP6_ADDRESS_1=746c:4285:417f::/64 886c:4285:417f:0:3734:3663:3a34:3238
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: IP6_ADDRESS_0=446c:4285:417f::/64 586c:4285:417f:0:3434:3663:3a34:3238
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: DHCP6_REQUESTED_DHCP6_DOMAIN_SEARCH=1
Feb 27 18:35:44 sloth /etc/NetworkManager/dispatcher.d/90-dumpenv: _=/usr/bin/env

$ sudo nmcli con show configured 879de7eb-503b-409e-a5bf-ca3af0ad047b
connection.id:                          WWAN
connection.uuid:                        879de7eb-503b-409e-a5bf-ca3af0ad047b
connection.interface-name:              --
connection.type:                        802-3-ethernet
connection.autoconnect:                 yes
connection.timestamp:                   1393522629
connection.read-only:                   no
connection.permissions:                 
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.secondaries:                 
connection.gateway-ping-timeout:        0
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          yes
802-3-ethernet.mac-address:             02:15:E0:EC:01:00
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.mac-address-blacklist:   
802-3-ethernet.mtu:                     auto
802-3-ethernet.s390-subchannels:        
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:            
ipv4.method:                            auto
ipv4.dns:                               
ipv4.dns-search:                        
ipv4.addresses:                         
ipv4.routes:                            
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv6.method:                            auto
ipv6.dns:                               2a00:e18:0:3::6
ipv6.dns-search:                        
ipv6.addresses:                         
ipv6.routes:                            
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.dhcp-hostname:                     --

$ sudo nmcli con show active 879de7eb-503b-409e-a5bf-ca3af0ad047b
GENERAL.NAME:                           WWAN
GENERAL.UUID:                           879de7eb-503b-409e-a5bf-ca3af0ad047b
GENERAL.DEVICES:                        enp0s26u1u5i6
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       yes
GENERAL.VPN:                            no
GENERAL.ZONE:                           --
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/4
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/0
GENERAL.SPEC-OBJECT:                    --
GENERAL.MASTER-PATH:                    --
IP6.ADDRESS[1]:                         ip = 2a00:e18:8000:148a:15:e0ff:feec:100/64, gw = fe80::215:e0ff:feec:101
IP6.ADDRESS[2]:                         ip = fe80::15:e0ff:feec:100/64, gw = fe80::215:e0ff:feec:101
IP6.DNS[1]:                             2a00:e18:0:3::6
DHCP6.OPTION[1]:                        dhcp6_client_id = 0:1:0:1:1a:8b:f7:5d:2c:59:e5:b9:d3:9e
DHCP6.OPTION[2]:                        dhcp6_name_servers = 2a00:e18:0:3::6
DHCP6.OPTION[3]:                        requested_dhcp6_name_servers = 1
DHCP6.OPTION[4]:                        requested_dhcp6_server_id = 1
DHCP6.OPTION[5]:                        requested_dhcp6_domain_search = 1
DHCP6.OPTION[6]:                        requested_dhcp6_client_id = 1
DHCP6.OPTION[7]:                        dhcp6_status_code = success
DHCP6.OPTION[8]:                        dhcp6_server_id = 0:1:0:1:0:0:10:5c:0:15:e0:ec:1:1

Tore
Comment 10 Michael Schaller 2014-03-14 12:23:09 UTC
I can also confirm this issue with Network Manager 0.9.8.8 dispatcher scripts on Ubuntu 14.04.


The interface em1 has this IP configuration:
$ ip addr show em1
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 44:37:e6:6f:03:00 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.4/23 brd 172.18.1.255 scope global em1
       valid_lft forever preferred_lft forever
    inet6 2620:0:1046:0:4637:e6ff:fe6f:300/64 scope global dynamic 
       valid_lft 2591949sec preferred_lft 604749sec
    inet6 fe80::4637:e6ff:fe6f:300/64 scope link 
       valid_lft forever preferred_lft forever


nm-tool also shows the correct IP configuration:
$ nm-tool

NetworkManager Tool

State: connected (global)

- Device: em1  [Wired connection 1] --------------------------------------------
  Type:              Wired
  Driver:            e1000e
  State:             connected
  Default:           yes
  HW Address:        44:37:E6:6F:03:00

  Capabilities:
    Carrier Detect:  yes
    Speed:           1000 Mb/s

  Wired Properties
    Carrier:         on

  IPv4 Settings:
    Address:         172.18.0.4
    Prefix:          23 (255.255.254.0)
    Gateway:         172.18.1.254

    DNS:             172.16.255.1
    DNS:             172.16.255.53
    DNS:             172.25.126.65

  IPv6 Settings:
    Address:         2620:0:1046:0:4637:e6ff:fe6f:300
    Prefix:          64
    Gateway:         fe80::5:73ff:fea0:65

    Address:         fe80::4637:e6ff:fe6f:300
    Prefix:          64
    Gateway:         fe80::5:73ff:fea0:65


I have this dispatcher script to log the dispatcher script environment to syslog:
$ cat /etc/NetworkManager/dispatcher.d/envdump
#!/bin/bash
env | logger -t nm-envdump


The syslog contains these environment variables: (shortened)
DEVICE_IP_IFACE=em1
DEVICE_IFACE=em1
IP6_NUM_ADDRESSES=2
IP6_ADDRESS_1=6489:9800::/64 7889:9800::3634:3839:3a39:3830
IP6_ADDRESS_0=3489:9800::/64 4889:9800::3334:3839:3a39:3830


This confirms that there is something wrong solely with the dispatcher section of Network Manager.

Best,

Michael Schaller
Comment 11 Michael Schaller 2014-03-14 12:40:16 UTC
IMHO the bug component 'IP and DNS config' is wrong and should be 'general'.
Comment 12 Michael Schaller 2014-03-14 13:24:14 UTC
nm-tool code:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/test/nm-tool.c?id=0.9.8.8#n564

dispatcher code:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/callouts/nm-dispatcher-utils.c?id=0.9.8.8#n271


nm-tool uses:
const struct in6_addr *ip;
char buf[INET6_ADDRSTRLEN];
inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)

dispatcher uses:
const struct in6_addr *tmp_addr;
char str_addr[INET6_ADDRSTRLEN + 1];
inet_ntop (AF_INET6, &tmp_addr, str_addr, sizeof (str_addr))


So essentially this is an issue because the tmp_addr pointer gets referenced.
Comment 13 Michael Schaller 2014-03-14 14:54:04 UTC
Oh... This already got fixed on 2013-12-09 by refactoring the code:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=6f2cfe263eabd452ad4efeb979ca9ef1db0578d7
Comment 14 Dan Williams 2014-03-14 15:21:07 UTC
(In reply to comment #13)
> Oh... This already got fixed on 2013-12-09 by refactoring the code:
> http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=6f2cfe263eabd452ad4efeb979ca9ef1db0578d7

Not in 0.9.8 though, which we should certainly do.
Comment 15 Michael Schaller 2014-03-14 15:23:44 UTC
Just removing the ampersand in front of tmp_addr is enough as a fix.
I've tested this fix on Ubuntu 12.04 (0.9.4.0) and 14.04 (0.9.8.8).
Comment 16 Thomas Haller 2014-03-14 16:24:59 UTC
Thank you Michael for tracking this down!!

Fixed in stable branch with:

http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-0-9-8&id=3655e07f79c2b5fdb99fde6d4b9b185fd84cf11f
Comment 17 Michael Schaller 2014-03-14 16:38:31 UTC
Thank you, Thomas.
Let me forward that to the maintainer of the network-manager package in Ubuntu too...
Comment 18 Michael Schaller 2014-03-14 16:44:10 UTC
Launchpad bug for Ubuntu 14.04:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1292605