diff --git a/src/Records/TypeDefinitions/TypeDefinitionManager.php b/src/Records/TypeDefinitions/TypeDefinitionManager.php index be4da0a..8420c2c 100644 --- a/src/Records/TypeDefinitions/TypeDefinitionManager.php +++ b/src/Records/TypeDefinitions/TypeDefinitionManager.php @@ -222,7 +222,7 @@ private function setDefinitions() 'priority' => Types::SHORT, 'weight' => Types::SHORT, 'port' => Types::SHORT, - 'name' => Types::DOMAIN_NAME | DomainName::FLAG_NO_COMPRESSION, + 'name' => Types::DOMAIN_NAME | (DomainName::FLAG_NO_COMPRESSION << 16), ], ResourceTypes::TXT => [ // RFC 1035 'txtdata+' => Types::CHARACTER_STRING, diff --git a/src/Records/Types/DomainName.php b/src/Records/Types/DomainName.php index 5247c27..1600fd6 100644 --- a/src/Records/Types/DomainName.php +++ b/src/Records/Types/DomainName.php @@ -22,7 +22,7 @@ */ class DomainName extends Type { - const FLAG_NO_COMPRESSION = 0x80000000; + const FLAG_NO_COMPRESSION = 0x8000; /** * @var string diff --git a/src/Records/Types/Long.php b/src/Records/Types/Long.php index 5ba9361..c67afe2 100644 --- a/src/Records/Types/Long.php +++ b/src/Records/Types/Long.php @@ -38,10 +38,12 @@ public function setValue($value) { $value = (int)$value; - if ($value < 0) { - throw new \UnderflowException('Long integer value must be in the range 0 - 4294967296'); - } else if ($value > 0xffffffff) { - throw new \OverflowException('Long integer value must be in the range 0 - 4294967296'); + if (4 !== \PHP_INT_SIZE) { + if ($value < 0) { + throw new \UnderflowException('Long integer value must be in the range 0 - 4294967296'); + } else if ($value > 0xffffffff) { + throw new \OverflowException('Long integer value must be in the range 0 - 4294967296'); + } } $this->value = $value;