Skip to content

Conversation

@xinchizhe
Copy link

When vip is IPv6 and every in6.s6_addr32 is same(for example 1:1:1:1:1:1:1:1), inet_addr_fold will return 0, be considered as an error(bad ip protocol)

When vip is IPv6 and every in6.s6_addr32 is same(for example 1:1:1:1:1:1:1:1),
inet_addr_fold will return 0, be considered as an error(bad ip protocol)
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where adding IPVS services fails when the IPv6 VIP has a specific pattern where all 32-bit segments are identical (e.g., 1:1:1:1:1:1:1:1). The issue occurred because inet_addr_fold returns 0 for such addresses, which was incorrectly interpreted as an invalid IP protocol.

Key changes:

  • Replace IP protocol validation logic to check address family directly instead of relying on inet_addr_fold return value
  • Fix error handling in service addition to properly clean up on hash failures

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ywc689 ywc689 added the pr/to-review-codes review codes line by line and check if problem exists. label Sep 16, 2025
Copy link
Collaborator

@ytwang0320 ytwang0320 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve +1

@ytwang0320 ytwang0320 added pr/codes-reviewed-ok code review passed and no problem found and removed pr/to-review-codes review codes line by line and check if problem exists. labels Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/codes-reviewed-ok code review passed and no problem found

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants