-
Notifications
You must be signed in to change notification settings - Fork 36
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
Adds IPV6_NETWORK method #53
base: main
Are you sure you want to change the base?
Conversation
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.
Hi @ldormoy , sorry for the delay and thanks for submitting the PR! The doc and test look good. It works as it supposes to.
I would like to address the duplication before merging it.
Could you also update the version in https://github.com/logstash-plugins/logstash-filter-fingerprint/blob/master/logstash-filter-fingerprint.gemspec#L4 and https://github.com/logstash-plugins/logstash-filter-fingerprint/blob/master/CHANGELOG.md ?
lib/logstash/filters/fingerprint.rb
Outdated
@@ -92,6 +97,16 @@ def register | |||
) | |||
end | |||
class << self; alias_method :fingerprint, :fingerprint_ipv4_network; end | |||
when :IPV6_NETWORK |
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.
As the implementation is the same as IPv4, I suggest to reuse the condition in ipv4 instead of duplicate the code
when :IPV4_NETWORK, :IPV6_NETWORK
lib/logstash/filters/fingerprint.rb
Outdated
@@ -151,6 +166,11 @@ def fingerprint_ipv4_network(ip_string) | |||
IPAddr.new(ip_string).mask(@key.to_i).to_s.force_encoding(Encoding::UTF_8) | |||
end | |||
|
|||
def fingerprint_ipv6_network(ip_string) |
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.
same as above, we can remove the duplication
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.
As mentioned, once it addresses, I can merge it
❌ Author of the following commits did not sign a Contributor Agreement: Please, read and sign the above mentioned agreement if you want to contribute to this project |
@ldormoy can you sign the contributor agreement to unblock me to merge? |
Solves #49
This PR adds an IPV6_NETWORK method, working the same way as IPV4_NETWORK.