Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Do not generate special purpose IPv4s
Browse files Browse the repository at this point in the history
Do not genate 255.255.255.255 (Broadcast) and IPs between 0.0.0.0 and 0.255.255.255 (0.0.0.0/8, current network).
  • Loading branch information
ravage84 committed Aug 26, 2015
1 parent 9ffdc01 commit ae3d5a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Faker/Provider/Internet.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function slug($nbWords = 6, $variableNbWords = true)
*/
public function ipv4()
{
return long2ip(mt_rand(0, 1) == 0 ? mt_rand(-2147483648, 0) : mt_rand(1, 2147483647));
return long2ip(mt_rand(0, 1) == 0 ? mt_rand(-2147483648, -2) : mt_rand(16777216, 2147483647));
}

/**
Expand Down

0 comments on commit ae3d5a9

Please sign in to comment.