Subject: | newhead() ignores $arcount argument when $nscount = 0 |
1: sub newhead {
2: my($bp,$id,$flags,$qdcount,$ancount,$nscount,$arcount) = @_;
3: return undef unless ref $bp;
4: return undef unless defined $id;
5: $qdcount = 0 unless $qdcount;
6: $ancount = 0 unless $ancount;
7: $nscount = 0 unless $nscount;
8: $arcount = 0 unless $nscount;
9: $$bp = pack("n n n n n
n",$id,$flags,$qdcount,$ancount,$nscount,$arcount);
10: return NS_HFIXEDSZ;
11: }
On 8th line there should be of course '$arcount = 0 unless $arcount;'