-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
Regex support for interfaces in network module #2853
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2853 +/- ##
==========================================
- Coverage 13.17% 13.14% -0.03%
==========================================
Files 162 162
Lines 11509 11532 +23
==========================================
Hits 1516 1516
- Misses 9993 10016 +23
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* Added warning message * Fixed memory Leak * Running adapters get preference
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 also run clang-format on the files you changed.
struct ifaddrs* ifaddrs; | ||
|
||
if (regexpr.empty()) | ||
return ""; |
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.
missing braces
m_interface = net::find_interface_regex(m_interface); | ||
|
||
if (!m_interface.empty()) | ||
m_log.notice("%s: Matched regex %s with interface %s", name(), regexpr, m_interface); |
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.
Missing braces
m_interface = net::find_interface_regex(m_interface); | ||
|
||
if (!m_interface.empty()) | ||
m_log.notice("%s: Matched regex %s with interface %s", name(), regexpr, m_interface); | ||
|
||
if (m_interface.empty()) { |
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.
If the regex doesn't match any interface, the module will shut down with the message Missing parameter "module/wireless.interface-type"
because m_interface
is empty again here.
If we tried to match using regex, we shouldn't try to use interface-type
, so something like this:
if (!m_interface.empty()) {
// match regex
} else {
// find interface type
}
What type of PR is this? (check all applicable)
Description
network module interface now supports regex
interface = wl.* will match any adapter named wlan0 wlan1 etc..
Related Issues & Documents
#2551
Documentation (check all applicable)