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

struct pcap bug on NetBSD 4.0_BETA2 (and possibly earlier) #89

Closed
guyharris opened this issue Apr 15, 2013 · 2 comments
Closed

struct pcap bug on NetBSD 4.0_BETA2 (and possibly earlier) #89

guyharris opened this issue Apr 15, 2013 · 2 comments

Comments

@guyharris
Copy link
Member

Converted from SourceForge issue 1675999, submitted by hans_rosenfeld

This one is really nasty.

In pcap-int.h, struct pcap is declared to contains a member "fddipad" if PCAP_FDDIPAD is defined, which is defined for NetBSD iff NetBSD_Version is above 106000000, NetBSD_Version is defined in <sys/param.h>.

It happens that pcap-bpf.c includes <sys/param.h>, so when pcap-int.h is included struct pcap is declared and used with the member fddipad. But in pcap.c, <sys/param.h> is not included, neither directly nor indirectly, so when pcap-int.h is included struct pcap is declared and used without the member fddipad.

Now pcap-bpf.c initializes a struct pcap with some function pointers, which just happen to be defined after fddipad. So when pcap.c tries to call such a function, it gets the wrong one. And then it breaks.

Solution:

include <sys/param.h> in pcap.c or pcap-int.h, maybe #ifdef'ed NetBSD

@guyharris
Copy link
Member Author

Submitted by guy_harris

Logged In: YES
user_id=541179
Originator: NO

I've checked into the main and x.9 branches a change that includes <sys/param.h> in pcap-int.h if NetBSD is defined. See if that works.

1 similar comment
@guyharris
Copy link
Member Author

Submitted by guy_harris

Logged In: YES
user_id=541179
Originator: NO

I've checked into the main and x.9 branches a change that includes <sys/param.h> in pcap-int.h if NetBSD is defined. See if that works.

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

No branches or pull requests

1 participant