Closed mrbesen closed 1 year ago
Do I understand correctly that this branch doesn't work at all on Windows? Could it be the changed include (ws2tcpip.h)?
Yes, it does not work on Windows.
I just tried to add the winsock2.h
everywhere where i include ws2tcpip.h
but it did not change anything.
It crashes instantly. No matter if i choose http, icmp, ipv4 or ipv6. Starting the program as admin does not help either.
How it looks to start cnping (the window closes itself shortly after):
Without an argument it creates this screen:
But after pressing "Ping" it goes back to the gray crash and closes 1s later.
There is never the error MessageBox you get from the ERRMB
macro.
Maybe i just f-ed something up compiling the exe file. (All though the file seems to work with wine - at least with ICMP Ping, HTTP Ping seems to be a bit broken too) Is there a way to download the exe file from the Ci Pipeline?
Is there a way to download the exe file from the Ci Pipeline?
Currently no, I might convert that to GH Actions sooner or later, then yes. What happens iff you compile the current master, does that work?
I just compiled the master and it did not work (same crash).
So looks like i am just not able to compile at all. (the 1.0.0 release binary works fine)
Do you have any tips on how to compile the binary?
I have made a simple docker container from the ubuntu:bionic
image and then installed the dependencys that the Ci installs too.
sudo apt update
sudo apt-get install -y make libxinerama-dev libxext-dev libx11-dev build-essential binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mesa-common-dev libglvnd-dev
And then i just compiled cnping with make cnping.exe
Nothing fancy, i just dont want all the mingw stuff on my main system.
I have no clue, your process sounds exactly right: As you said, that's what the CI does. I'll try to look into it and get back to you. Does an older version of cnping.exe work? I once had crashes because of missing drivers or such, especially on a VM.
Update: You mentioned that 1.0.0 works, so that sounds like some of the build dependencies had a "breaking change", doesn't it?
I have just compiled the 1.0.0 tag and it worked. So it looks like the bug is somewhere between 1.0.0 and master.
Maybe something with rawdraw? It wasnt a submodule back then (I made sure the rawdraw/ content is there when i compiled it).
Edit: at first glance it looks like this is the same bug: #83 I can try the binary on a bare metal device later.
Ok, i have now tested the binary on a bare metal windows10 and it seems to work the same as the 1.0.0 binary. Looks like something inseide rawdraw made it incompatible with my VM?
What do i mean with "the same as the 1.0.0 binary"?
One problem: when i use a DNS-name, that has an A-record and an AAAA-record (ipv4 and ipv6) it uses the AAAA-record and failes, because ipv6 is not implemented. The last commit fixes that.
Edit: The VM i used for testing is kvm (qemu) with windows10. This is the configuration:
sudo kvm -drive file=$device,media=disk,cache=writeback,index=0,aio=threads,format=raw -m 12G -cpu host -smp cores=8,threads=1,sockets=1 -k de -vga std -display gtk -runas $USER
I have now removed the commit where i implemented the alternative (old) resolve method for windows and the commit where i reverted that change.
I would be happy if you could merge this.
Hi sorry this has been on my todo list for some time now. I'd like to test it myself on Windows again but haven't found the time. I'm sure I can do that in the first half of December, would that be sufficient for you or do you need it merged faster for some reason?
No, take your time.
This adds IPv6 support as mentioned in #39 . It works on Linux with ICMP and HTTP-Ping. (Of cause IPv4 still works)
You can enter a host by its ipv4 address (
1.1.1.1
), its ipv6 address (2a03:4000:2b:41f::4
) or by its hostname (ipv4.mrbesen.de
oripv6.mrbesen.de
). HTTP ping still works just by prependinghttp://
and the Device option (-I
) also works.To allow for resolving ipv6 addresses i moved from
gethostbyname()
togetaddrinfo()
. All the code for resolving the address is inresolve.c
.I could not get it to work on Windows. I tried different ways of compiling the code for windows. Crosscompiling it with Mingw created a exe file that kinda worked with wine but straight up crashed on my win10 vm (no matter the arguments). I implemented the old
gethostbyname()
resolve method for windows but it did not help. I have no experience developing C-Applications on Windows and i have no idea where to start the debugging, or even how or which debugger to use on Windows.Maybe someone more "Windows-experienced" can take a look on the windows side of this PR.
I have not added any way of forcing ipv6 or ipv4 (for example a
-4
or-6
option) the only way would be to just use the plain address instead of the hostname. I think that is fine for now and would be fairly easy to implement, becausegetaddrinfo()
allows for a hint which can force the resolver to focus on ipv4 or ipv6.P.S: Feel free to use my server as test target (
ipv4.mrbesen.de
,ipv6.mrbesen.de
andmrbesen.de
)