Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

ldormoy
Copy link

@ldormoy ldormoy commented Oct 2, 2019

Solves #49
This PR adds an IPV6_NETWORK method, working the same way as IPV4_NETWORK.

Copy link
Contributor

@kaisecheng kaisecheng left a 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 ?

@@ -92,6 +97,16 @@ def register
)
end
class << self; alias_method :fingerprint, :fingerprint_ipv4_network; end
when :IPV6_NETWORK
Copy link
Contributor

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

@@ -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)
Copy link
Contributor

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

Copy link
Contributor

@kaisecheng kaisecheng left a 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

@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
2f90ce7, 5fb56df,

Please, read and sign the above mentioned agreement if you want to contribute to this project

@kaisecheng
Copy link
Contributor

@ldormoy can you sign the contributor agreement to unblock me to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants