[-] compare virtual IP addresses instead of matching text - #427
Open
pashagolub wants to merge 1 commit into
Open
pashagolub wants to merge 1 commit into
pashagolub wants to merge 1 commit into
Conversation
* queryAddress() compared the addresses of the interface with the CIDR of the virtual IP using strings.Contains(), so an interface carrying 127.0.0.1/8 answered that 27.0.0.1/8 was assigned to it. A false positive means the manager believes the address is already up and never configures it, and the node silently never takes the virtual IP. Parse both sides and compare the address and the prefix length. * getMask() returned the nil mask of net.CIDRMask() for an out of range value, and netmaskSize() panicked on it later - with the manager already running. "--netmask=-1" is the documented default and was enough to reach that with an IPv6 address. The mask is validated now and a bad one is reported when the manager is created. For IPv4 a value of zero or less keeps selecting the default mask of the address class. * --netmask is an int flag now, so a value that is not a number is rejected while the flags are parsed instead of being coerced silently. * an IPv6 virtual IP no longer produces an ARP packet with a 16 byte address in its 4 byte address fields. ARP is IPv4 only, the IPv6 equivalent is an unsolicited neighbour advertisement which is not implemented, so the missing announcement is logged instead. Assigning the address itself is unaffected.
pashagolub
force-pushed
the
fix/vip-address-detection
branch
from
September 14, 2026 15:37
9a6d043 to
c46ea59
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
queryAddress() compared the addresses of the interface with the CIDR of the virtual IP using strings.Contains(), so an interface carrying 127.0.0.1/8 answered that 27.0.0.1/8 was assigned to it. A false positive means the manager believes the address is already up and never configures it, and the node silently never takes the virtual IP. Parse both sides and compare the address and the prefix length.
getMask() returned the nil mask of net.CIDRMask() for an out of range value, and netmaskSize() panicked on it later - with the manager already running. "--netmask=-1" is the documented default and was enough to reach that with an IPv6 address. The mask is validated now and a bad one is reported when the manager is created. For IPv4 a value of zero or less keeps selecting the default mask of the address class.
--netmask is an int flag now, so a value that is not a number is rejected while the flags are parsed instead of being coerced silently.
an IPv6 virtual IP no longer produces an ARP packet with a 16 byte address in its 4 byte address fields. ARP is IPv4 only, the IPv6 equivalent is an unsolicited neighbour advertisement which is not implemented, so the missing announcement is logged instead. Assigning the address itself is unaffected.