Skip to content

device: disable IPv6 in NetworkManager when disabled in kernel

Yuki Inoguchi requested to merge yinoguchi/NetworkManager:main into main

Summary

Disable IPv6 in NetworkManager when disabled in kernel.

Purpose

When IPv6 is disabled in kernel but ipv6.method is set to auto, NetworkManager repeatedly attempts IPv6 configuration internally, resulting in unnecessary warning messages being output infinitely:

# cat /proc/cmdline
BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-477.10.1.el8_8.x86_64 ...... ipv6.disable=1

# nmcli con show ens10 | grep ipv6.method
ipv6.method: auto

# journalctl -u NetworkManager | grep warn | head
Sep 21 16:49:50 system NetworkManager[932]: [1695282590.9237] platform-linux: do-add-ip6-address[2: fe80::5054:ff:fe7c:4293]: failure 95 (Operation not supported)
Sep 21 16:49:52 system NetworkManager[932]: [1695282592.9243] ipv6ll[e898db403d9b5099,ifindex=2]: changed: no IPv6 link local address to retry after Duplicate Address Detection failures (back off)
Sep 21 16:50:02 system NetworkManager[932]: [1695282602.9325] platform-linux: do-add-ip6-address[2: fe80::5054:ff:fe7c:4293]: failure 95 (Operation not supported)
Sep 21 16:50:04 system NetworkManager[932]: [1695282604.9304] ipv6ll[e898db403d9b5099,ifindex=2]: changed: no IPv6 link local address to retry after Duplicate Address Detection failures (back off)
Sep 21 16:50:14 system NetworkManager[932]: [1695282614.9390] platform-linux: do-add-ip6-address[2: fe80::5054:ff:fe7c:4293]: failure 95 (Operation not supported)
Sep 21 16:50:16 system NetworkManager[932]: [1695282616.9398] ipv6ll[e898db403d9b5099,ifindex=2]: changed: no IPv6 link local address to retry after Duplicate Address Detection failures (back off)
Sep 21 16:50:26 system NetworkManager[932]: [1695282626.9446] platform-linux: do-add-ip6-address[2: fe80::5054:ff:fe7c:4293]: failure 95 (Operation not supported)
Sep 21 16:50:28 system NetworkManager[932]: [1695282628.9455] ipv6ll[e898db403d9b5099,ifindex=2]: changed: no IPv6 link local address to retry after Duplicate Address Detection failures (back off)
Sep 21 16:50:38 system NetworkManager[932]: [1695282638.9578] platform-linux: do-add-ip6-address[2: fe80::5054:ff:fe7c:4293]: failure 95 (Operation not supported)
Sep 21 16:50:40 system NetworkManager[932]: [1695282640.9588] ipv6ll[e898db403d9b5099,ifindex=2]: changed: no IPv6 link local address to retry after Duplicate Address Detection failures (back off)

To prevent this issue, let's disable ipv6 in NetworkManager when it is disabled in the kernel.

Fixes #1040 (closed)

Checklist

Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:

  • the subject for all commits is concise and explicative
  • the message for all commits explains the reason for the change
  • the source is properly formatted
  • any relevant documentation is up to date
  • you have added unit tests if applicable

Merge request reports