ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Function getaddrinfo() vanished in one of the later commits.

Date: Fri, 4 Jan 2019 23:38:06 +0100

On 4-1-2019 21:53, Guy Harris wrote:
On Jan 4, 2019, at 3:59 AM, hdv <henri.de.veer@xxxxxxxxx> wrote:

In the extcap plugin I'm developing I used the getaddrinfo() call to resolve hostnames. This should be favorable over gethostname() which is actually deprecated AFAIK.

The previous commit I was developing on was around june 14th, 2018 (27a1906c582b..) where it still worked, now after rebasing to the latest master commit (29bfeccc8db0..) I see the function is vanished.

This is the link error I get:

anagate-core.obj : error LNK2019: unresolved external symbol __imp_getaddrinfo referenced in function socket_open [c:\development\wsbuild64\extcap\anagate.vcxproj]

I can't find any header file where it is defined. It should be somewhere in glibc.
glibc?  Do you mean GNU libc?
I'm not a guru on CMake, so no idea if the libraries are binary loaded (probably) or built locally. I even don't know in which lib it was before, it just worked and now this surprises me. I followed the installation instructions (more or less) for windows mentioned in the documentation.

If so, then it will only be in glibc if you've installed glibc on Windows.

But why are you linking with glibc when building for, and on, Windows?  Do you need to use glibc rather than the native Windows libraries?  According to the Windows documentation for getaddrinfo():

	https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo

which says

	The getaddrinfo function was added to the Ws2_32.dll on Windows XP

It's in the Ws2_32 library, so why not link with that?

No idea what is linked in windows exactly, it was working in the old commit and after rebase to one of the latest commits it does not link any more. So I would say it is a regression issue?

Something is ripped out of a library (in the wireshark codebase), it is virtually impossibly to dig thru 1/2 a year of commits to find the cause.

I did not change anything on my system.


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
              mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe