-
Notifications
You must be signed in to change notification settings - Fork 923
dnsdist: Add more Lua bindings for network-related operations #11994
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
Merged
rgacogne
merged 9 commits into
PowerDNS:master
from
rgacogne:ddist-more-lua-net-bindings
Oct 10, 2022
Merged
dnsdist: Add more Lua bindings for network-related operations #11994
rgacogne
merged 9 commits into
PowerDNS:master
from
rgacogne:ddist-more-lua-net-bindings
Oct 10, 2022
Conversation
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
807f156
to
8786f37
Compare
CI failure is unrelated. |
7 tasks
chbruyand
reviewed
Oct 7, 2022
}); | ||
|
||
luaCtx.registerFunction<bool (std::shared_ptr<dnsdist::NetworkListener>::*)(const std::string&, uint16_t, std::function<void(uint16_t, std::string & dgram, const std::string& from)>)>("addUnixListeningEndpoint", [client](std::shared_ptr<dnsdist::NetworkListener>& listener, const std::string& path, uint16_t endpointID, std::function<void(uint16_t endpoint, std::string & dgram, const std::string& from)> cb) { | ||
if (client) { |
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.
Suggested change
if (client) { | |
if (client || !cb) { |
|
||
#if HAVE_GETIFADDRS | ||
static uint8_t convertNetmaskToBits(const struct in_addr* mask, socklen_t len) | ||
{ |
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.
Maybe check mask isn't null before accessing it's content
8786f37
to
dbe1fe7
Compare
chbruyand
approved these changes
Oct 10, 2022
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.
Short description
getListOfRangesOfNetworkInterface
: returns the list of network ranges configured on a given interface, which is useful to define dynamic ACLs from LuagetResolvers
: parses an/etc/resolv.conf
-like file and returns a list of IP addresses (with ports)vinfolog
: log a line if dnsdist is running in verbose modeChecklist
I have: