]> git.proxmox.com Git - mirror_corosync.git/commit - exec/coroparse.c
totemconfig: Enhance totem.ip_version
authorJan Friesse <jfriesse@redhat.com>
Thu, 13 Dec 2018 15:50:49 +0000 (16:50 +0100)
committerJan Friesse <jfriesse@redhat.com>
Fri, 14 Dec 2018 09:56:06 +0000 (10:56 +0100)
commita84ade701c52f65bb0856206c41631c294af754f
tree727c404b042ade968c4ce350a29d227522a046b2
parentaa7daf8c7705e252180f82fe0d8b7f3b9438cd5b
totemconfig: Enhance totem.ip_version

Originally totem.ip_version was used to force ip version used by totem.
With Knet this variable didn't make too much sense so it was not used.

Sadly rely only on DNS resolver order doesn't always work (RFC is quite
complicated, but if IPv6 is not configured then IPv4 is preferred), what
we tried to solve by forcing IPv6 and only if that fails, use IPv4.

Sadly this collides with nss_myhostname which is able to return every
local address and today system usually have at least one autogenerated
link-local IPv6 address so it is able to "overwrite" /etc/hosts.

Solution is to enhance totem.ip_version and use it also for Knet.
totem.ip_version is now just a flag for resolver and can have four
states: ipv4 (only IPv4 is used), ipv6 (only IPv6 is used), ipv4-6 (ask
IPv4 first and if it fails ask for IPv6) and ipv6-4 (ask IPv6 first and
if it fails ask for IPv4). Default for Knet and UDPU transports is
ipv6-4, for UDP it's ipv4, because autogenerated mcast addr doesn't play
too well with ipv6-4.

So everywhere where nss_myhostname becomes problem, it's just possible
to set totem.ip_version to ipv4-6.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
exec/coroparse.c
exec/main.c
exec/totemconfig.c
exec/totemip.c
include/corosync/totem/totem.h
include/corosync/totem/totemip.h
man/corosync.conf.5