Skip to content

Conversation

@luohoufu
Copy link
Contributor

@luohoufu luohoufu commented Jan 23, 2025

What does this PR do

This pull request includes changes to centralize and standardize the use of network address constants across the codebase. The most important changes include the introduction of new constants for reserved and local addresses, and the replacement of hardcoded address strings with these constants.

Centralization and standardization of network address constants:

  • core/util/netutils.go: Introduced new constants ReservedAddress, LocalIpv6Address, and LocalAddress to represent common network addresses.
  • core/util/netutils.go: Replaced hardcoded address strings with the newly defined constants in various functions, such as GetSafetyInternalAddress, GetValidAddress, GetLocalIPs, and ClientIP. [1] [2] [3] [4]

Refactoring to use new address constants:

  • core/api/api.go: Updated the StartAPI function to use the ReservedAddress constant instead of the hardcoded "0.0.0.0" string.
  • core/host/process_info.go: Imported the util package and replaced hardcoded address strings with the new constants in the getPortByPidWindows function. [1] [2]

Rationale for this change

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@luohoufu luohoufu requested review from medcl and silenceqi January 23, 2025 06:37
@medcl
Copy link
Member

medcl commented Feb 13, 2025

fix conflicts

@luohoufu luohoufu merged commit 5131afa into main Feb 13, 2025
5 checks passed
@luohoufu luohoufu deleted the ip_typo_pr branch February 13, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants