Skip to content

Commit

Permalink
- fixed a bug that I introduced in Net_DNS2_Header in this release, w…
Browse files Browse the repository at this point in the history
…hich was breaking DNS updates
  • Loading branch information
mikepultz committed Feb 12, 2017
1 parent c46c12d commit 35e8beb
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Net/DNS2/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,22 +253,17 @@ public function set(Net_DNS2_Packet &$packet)
*/
public function get(Net_DNS2_Packet &$packet)
{
$data = pack('n', $this->id) .
$packet->offset += Net_DNS2_Lookups::DNS_HEADER_SIZE;

return pack('n', $this->id) .
chr(
($this->qr >> 7) | ($this->opcode >> 3) |
($this->aa >> 2) | ($this->tc >> 1) | ($this->rd)
($this->qr << 7) | ($this->opcode << 3) |
($this->aa << 2) | ($this->tc << 1) | ($this->rd)
) .
chr(
($this->ra >> 7) | ($this->ad >> 5) | ($this->cd >> 4) | $this->rcode
($this->ra << 7) | ($this->ad << 5) | ($this->cd << 4) | $this->rcode
) .
chr($this->qdcount >> 8) . chr($this->qdcount) .
chr($this->ancount >> 8) . chr($this->ancount) .
chr($this->nscount >> 8) . chr($this->nscount) .
chr($this->arcount >> 8) . chr($this->arcount);

$packet->offset += Net_DNS2_Lookups::DNS_HEADER_SIZE;

return $data;
pack('n4', $this->qdcount, $this->ancount, $this->nscount, $this->arcount);
}
}

Expand Down

0 comments on commit 35e8beb

Please sign in to comment.