Skip to content

Adds IPV6_NETWORK method#53

Open
ldormoy wants to merge 4 commits intologstash-plugins:mainfrom
ldormoy:master
Open

Adds IPV6_NETWORK method#53
ldormoy wants to merge 4 commits intologstash-plugins:mainfrom
ldormoy:master

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 ?

)
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

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