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

Error on armv4l & armv5l : cann't get correct ipv4 address #2

Open
supermufasha opened this issue Aug 9, 2018 · 1 comment
Open

Comments

@supermufasha
Copy link

Error on armv4l & armv5l : cann't get correct ipv4 address

/tmp # ./ns google.com 8.8.8.8
Resolving google.com
Sending Packet to 8.8.8.8
Querying done
Receiving answer...
Answer received
The server used is a non-authoritative server in the domain

The response contains :
1 Questions.
1 Answers.
0 Authoritative Servers.
0 Additional records.

Answer Records : 1
Name : google.com has IPv4 address : 200.14.0.0

Authoritive Records : 0

Additional Records : 0

@supermufasha supermufasha changed the title **Error on armv4l & armv5l : cann't get correct ipv4 address** Error on armv4l & armv5l : cann't get correct ipv4 address Aug 9, 2018
@supermufasha
Copy link
Author

supermufasha commented Aug 9, 2018

// error: sizeof( struct R_DATA ) == 12 when on armv4 & armv5
#pragma pack(push, 1)
struct R_DATA /*RESOURCE RECORD DATA*/ {
    uint16_t type;
    uint16_t _class;
    uint32_t ttl;
    uint16_t data_len;
};
#pragma pack(pop)

** the correct code as below:**

struct R_DATA /*RESOURCE RECORD DATA*/ {
    uint16_t type;
    uint16_t _class;
    uint32_t ttl;
    uint16_t data_len;
}__attribute__((packed));

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

No branches or pull requests

1 participant