Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set DnsResource of DNS_TYPE_A to "0.0.0.0", is there any workaround? #1654

Open
ikraduya opened this issue Dec 7, 2024 · 3 comments
Labels

Comments

@ikraduya
Copy link

ikraduya commented Dec 7, 2024

Question

I got errors during runtime when trying to set "0.0.0.0" to a DNS packet answer data.

pcpp::DnsResource* answer = dnsLayer->getFirstAnswer();

static pcpp::IPv4DnsResourceData ipv4Block("0.0.0.0");
answer->setData(&ipv4Block);

The error shows:

[ERROR: C:\vcpkg\buildtrees\pcapplusplus\src\v22.11-e3390d66ff.clean\Packet++\src\DnsResourceData.cpp: pcpp::IPv4DnsResourceData::toByteArr:65] Cannot convert IPv4 address to byte array because address is not valid
[ERROR: C:\vcpkg\buildtrees\pcapplusplus\src\v22.11-e3390d66ff.clean\Packet++\src\DnsResource.cpp: pcpp::DnsResource::setData:409] Cannot convert DNS resource data to byte array, data is probably invalid

Is there any workaround to achieve this in pcpp?

Operating systems

Windows

@tigercosmos
Copy link
Collaborator

@ikraduya which PcapPlusPlus version is it?

@ikraduya
Copy link
Author

It's 22.11

@tigercosmos
Copy link
Collaborator

@ikraduya I see. The IP issue should have been resolved after that. Could you try to use the latest master or the latest release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants