Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #637] Fix filter lookback interface for utils.ClientIP #700

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

kallydev
Copy link
Contributor

@kallydev kallydev commented Jul 9, 2021

What is the purpose of the change

Resolved #637.

Brief changelog

By filtering the loopback type and the non-up state of the interface, we can get a correct and available client IP.

Verifying this change

go test -v internal/utils/net.go internal/utils/net_test.go 

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when a cross-module dependency exists.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2021

Codecov Report

Merging #700 (b6ab883) into master (8612bf7) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #700      +/-   ##
==========================================
+ Coverage   25.20%   25.25%   +0.05%     
==========================================
  Files          48       48              
  Lines        5269     5270       +1     
==========================================
+ Hits         1328     1331       +3     
+ Misses       3733     3732       -1     
+ Partials      208      207       -1     
Impacted Files Coverage Δ
internal/utils/net.go 52.94% <100.00%> (+15.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8612bf7...b6ab883. Read the comment docs.

@wenfengwang
Copy link
Member

LGTM @maixiaohai

@maixiaohai
Copy link
Contributor

merged

@maixiaohai maixiaohai merged commit e94bf49 into apache:master Jul 13, 2021
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.

[Master][bug]utils.LocalIp sometimes is a looback ip
4 participants