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

count method in Network returns improper value for IPv6 #15

Open
hpartidas opened this issue Nov 28, 2016 · 1 comment
Open

count method in Network returns improper value for IPv6 #15

hpartidas opened this issue Nov 28, 2016 · 1 comment

Comments

@hpartidas
Copy link

Hello,

Just recently started working with your classes and realized that the number of hosts for a 64 bit mask in an IPv6 address is being erroneously returned.

Delving into the framework I noticed that you're using bcpow function for IPv6 networks and this keeps returning an unexpected value. In fact after testing with different bit masks, it always caps at 9,223,372,036,854,775,808.

I don't know your reasons for not using the pow function but bcpow is completely breaking IPv6.

petski added a commit to petski/IPTools that referenced this issue Mar 17, 2017
@LinkingYou
Copy link

Hi,
Unfortunately, this error is still not fixed. The solution from the suggested commit works perfectly for me.
Can't you accept the fix and tag a new version?
That would be awesome!
Thanks!

Current version:

dump(Range::parse('1::/0')->count());
9223372036854775807

Suggested fix:

dump(Range::parse('1::/0')->count());
"340282366920938463463374607431768211456"

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

No branches or pull requests

2 participants