-
Notifications
You must be signed in to change notification settings - Fork 1.1k
change listening to all ip address type for some NIC name not start w… #261
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,18 +30,12 @@ | |
|
|
||
| namespace hf3fs::net { | ||
|
|
||
| static bool checkNicType(std::string_view nic, Address::Type type) { | ||
| switch (type) { | ||
| case Address::TCP: | ||
| return nic.starts_with("en") || nic.starts_with("eth") || nic.starts_with("bond") || nic.starts_with("xgbe"); | ||
| case Address::IPoIB: | ||
| return nic.starts_with("ib"); | ||
| case Address::RDMA: | ||
| return nic.starts_with("en") || nic.starts_with("eth") || nic.starts_with("bond") || nic.starts_with("xgbe"); | ||
| case Address::LOCAL: | ||
| return nic.starts_with("lo"); | ||
| default: | ||
| return false; | ||
| static bool checkNicType(Address::Type type) { | ||
| // listen to all ip address type for some NIC not start with en eth,bond, except for the Unix type | ||
| if (type == Address::UNIX){ | ||
| return false; | ||
| } else { | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -65,7 +59,7 @@ Result<Void> Listener::setup() { | |
|
|
||
| auto &filters = config_.filter_list(); | ||
| for (auto [name, addr] : nics.value()) { | ||
| if (addr.up && (filters.empty() || filters.count(name) != 0) && checkNicType(name, networkType_)) { | ||
| if (addr.up && (filters.empty() || filters.count(name) != 0) && checkNicType(networkType_)) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider deleting the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. networkType_ is not get from IfAddrs::load(), funny
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in this case ,this fun post "RDMA" to networkType_, NIC only filter by name
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SF-Zhou any suggestion? |
||
| addressList_.push_back(Address{addr.ip.toLong(), | ||
| config_.listen_port(), | ||
| networkType_ == Address::LOCAL ? Address::TCP : networkType_}); | ||
|
|
||
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.
inetworkType_ is not get from load (), this fun post "RDMA" to networkType_, this case , NIC only filter by name