-
Type:
Bug
-
Status: Done
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.15.0
-
Component/s: None
-
Labels:None
sys.ip_addresses does not return ipv6 addresses. It should.
For testing/reproducing a VM can be used, for example in vagrant:
https://github.com/cfengine/starter_pack/pull/23/files#diff-23b6f443c01ea2efcb4f36eedfea9089R45
After setting up a VM and installing CFEngine community (running autogen, make, make install in masterfiles and core), reproducing is easy:
root@dev core $ cf-key root@dev core $ cf-agent -B 192.168.100.10 R: Bootstrapping from host '192.168.100.10' via built-in policy '/var/cfengine/inputs/failsafe.cf' R: This host assumes the role of policy server R: Updated local policy from policy server R: Triggered an initial run of the policy R: Restarted systemd unit cfengine3 notice: Bootstrap to '192.168.100.10' completed successfully! root@dev core $ ifconfig enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255 inet6 fe80::cc:50ff:fedf:d9b9 prefixlen 64 scopeid 0x20<link> ether 02:cc:50:df:d9:b9 txqueuelen 1000 (Ethernet) RX packets 183710 bytes 247215905 (247.2 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 19581 bytes 1503386 (1.5 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.100.10 netmask 255.255.255.0 broadcast 192.168.100.255 inet6 fe80::a00:27ff:fed2:27e7 prefixlen 64 scopeid 0x20<link> ether 08:00:27:d2:27:e7 txqueuelen 1000 (Ethernet) RX packets 5 bytes 342 (342.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 21 bytes 1516 (1.5 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::a00:27ff:fe6c:eeaa prefixlen 64 scopeid 0x20<link> inet6 fde4:8dba:82e1::c4 prefixlen 64 scopeid 0x0<global> ether 08:00:27:6c:ee:aa txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 18 bytes 1472 (1.4 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 198 bytes 18064 (18.0 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 198 bytes 18064 (18.0 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 root@dev core $ cf-promises --show-vars | grep ip_addresses default:sys.ip_addresses {"127.0.0.1","10.0.2.15","192.168.100.10"} source=agent root@dev core $
We want to add IPv6 addresses from the inet6 lines to the sys.ip_addresses list.
The fix should be very similar to:
https://github.com/cfengine/core/pull/3801/commits/83d3d2b0636209bef2549324121dead40399c9df