Fix the IP address retrieval error#2051
Merged
Merged
Conversation
yu199195
reviewed
Sep 10, 2021
yu199195
reviewed
Sep 10, 2021
yu199195
reviewed
Sep 10, 2021
Member
|
why not add some test about the util either? I think it can help us review too. |
yu199195
reviewed
Sep 10, 2021
yu199195
reviewed
Sep 10, 2021
yu199195
reviewed
Sep 10, 2021
Member
|
pls add finnal to all Method parameters |
Codecov Report
@@ Coverage Diff @@
## master #2051 +/- ##
============================================
- Coverage 62.18% 60.66% -1.53%
- Complexity 4012 4031 +19
============================================
Files 594 606 +12
Lines 17408 17833 +425
Branches 1665 1704 +39
============================================
- Hits 10826 10819 -7
- Misses 5721 6133 +412
- Partials 861 881 +20
Continue to review full report at Codecov.
|
yu199195
approved these changes
Sep 10, 2021
Member
|
@xiaheshun welcome to join apache shenyu controbutor 。 you can add my wechat: xixy199195 |
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.
// Describe your PR here; eg. Fixes #issueNo
Make sure that:
-------------------------------------------test code----------------------------------------------------------
The original code:
if (!ip.isLoopbackAddress()){
System.out.print(ip.getHostAddress());
System.out.print("-------");
System.out.print(netInterface.getDisplayName());
System.out.print("-------");
System.out.print(netInterface.getName());
System.out.println();
}
fe80:0:0:0:3507:b35:d4e4:ebf3%eth2-------Bluetooth Device (Personal Area Network)-------eth2
fe80:0:0:0:7881:df0f:e380:188b%wlan2-------Microsoft Wi-Fi Direct Virtual Adapter-------wlan2
172.23.39.81-------Intel(R) Ethernet Connection (3) I218-LM-------eth3
fe80:0:0:0:58b0:4f02:d55e:4f32%eth3-------Intel(R) Ethernet Connection (3) I218-LM-------eth3
fe80:0:0:0:8010:123e:b12b:1e57%wlan3-------Intel(R) Dual Band Wireless-AC 7265-------wlan3
192.168.137.1-------Microsoft Wi-Fi Direct Virtual Adapter #2-------wlan4
fe80:0:0:0:e495:d3f:9590:e7d7%wlan4-------Microsoft Wi-Fi Direct Virtual Adapter #2-------wlan4
192.168.16.1-------Hyper-V Virtual Ethernet Adapter-------eth22
fe80:0:0:0:9d08:73ac:5e28:4f53%eth22-------Hyper-V Virtual Ethernet Adapter-------eth22
------------------------------------------test code-----------------------------------------------------------
These are the network cards for my laptop. The shenyu utility class only gets IP 192.168.16.1, but my real IP is 172.23.39.81.
I had fix the IP address retrieval error.
Use the new rule:
example: eth3 172.23.39.81 | eth22 192.168.16.1 | wlan4 192.168.137.1
I will spit as "name namePostfix ipv4Postfix"
"eth 3 81", "eth 22 1", "wlan 4 1"
then, sort the list:
first rule: name (other name<"enp"<"eth"<"bond")
second rule: namePostfix ( 3[eth] > 22[eth] > 4[wlan])
third rule : ipv4Postfix ( 81[172.23.39.81] > 1[192.168.16.1] > 1[192.168.137.1] )
then, keep old filter (ipv4).
mvn clean install -Dmaven.javadoc.skip=true.