-
Notifications
You must be signed in to change notification settings - Fork 55
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
use big endian to restore IP #147
Conversation
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
cc @kwb0523 |
@@ -54,5 +54,5 @@ func ConvertPortToBigEndian(little uint32) uint32 { | |||
|
|||
// ConvertIpByteToUint32 converts ip to little-endian uint32 format | |||
func ConvertIpByteToUint32(ip []byte) uint32 { | |||
return binary.LittleEndian.Uint32(ip) | |||
return binary.BigEndian.Uint32(ip) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update the function comments as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 29 in 67e8346
func ConvertIpToUint32(ip string) uint32 { |
Should this function also be modified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on the caller, i think we get the IP slices from istiod.
pkg/nets/nets.go
Outdated
@@ -54,5 +54,5 @@ func ConvertPortToBigEndian(little uint32) uint32 { | |||
|
|||
// ConvertIpByteToUint32 converts ip to little-endian uint32 format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ConvertIpByteToUint32 converts ip to little-endian uint32 format | |
// ConvertIpByteToUint32 converts big-endian ip slices to uint32 format |
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
@kwb0523 Not sure, let's make a pr as smaller as possible. Not to couple with that bigger refactor one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
Which issue(s) this PR fixes:
Fixes #146