Reduce the exception noise with queries that we dont parse correctly
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Classes\Protocol\DNS;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\Protocol\DNS;
|
||||
|
||||
@@ -26,8 +27,15 @@ final class RR
|
||||
$domain = strstr($buf,"\x00",TRUE);
|
||||
$i += strlen($domain)+1;
|
||||
|
||||
$this->type = Arr::get(unpack('n',substr($buf,$i,2)),1);
|
||||
$this->class = Arr::get(unpack('n',substr($buf,$i+2,2)),1);
|
||||
try {
|
||||
$this->type = Arr::get(unpack('n',substr($buf,$i,2)),1);
|
||||
$this->class = Arr::get(unpack('n',substr($buf,$i+2,2)),1);
|
||||
|
||||
} catch (\ErrorException $e) {
|
||||
Log::error(sprintf('%s:! Error unpacking buffer [%s]',self::LOGKEY,$buf),['buf'=>hex_dump($buf)]);
|
||||
return;
|
||||
}
|
||||
|
||||
$i += 4;
|
||||
|
||||
switch ($this->type) {
|
||||
|
Reference in New Issue
Block a user