Files
termux-packages/packages/nmap/libdnet-stripped-configure.patch
termux-pacman-bot cc317b2fd6 fix(main/nmap): fix configure-time check for PF_PACKET support in libdnet
- Fixes https://github.com/termux/termux-packages/issues/25258

- After 210d6c0847, `nmap` has upgraded to a `libdnet` 1.18.0. Unfortunately, this version of `libdnet` includes a malformed autotools configure-time compiler check for the definition of `ETH_P_ALL` that has a function defintion inside another function definition, causing a near-silent error `error: function definition is not allowed here` when **Clang** is used to compile (as opposed to GCC, which is somehow able to successfully compile the same code):

06ecd5d459/configure (L15565-L15571)

- This works around the problem by patching the `libdnet-stripped/configure` file to run the check in such a way that the code checking for `ETH_P_ALL` properly compiles with no errors.

- Issue opened upstream here: https://github.com/ofalk/libdnet/issues/109
2025-07-08 01:34:59 +00:00

32 lines
828 B
Diff

Fixes this error in the configure-time test for "Linux PF_PACKET sockets":
test.c:7:11: error: function definition is not allowed here
7 | int foo() { return ETH_P_ALL; }
| ^
1 error generated.
Which changes this configure log message:
checking for Linux PF_PACKET sockets... no
to this:
checking for Linux PF_PACKET sockets... yes
which fixes this error in the command 'sudo nping --arp 192.168.12.1':
doArp: failed to open device wlan0
--- a/libdnet-stripped/configure
+++ b/libdnet-stripped/configure
@@ -15116,10 +15116,10 @@ printf %s "checking for Linux PF_PACKET sockets... " >&6; }
/* end confdefs.h. */
#include <netpacket/packet.h>
#include <linux/if_ether.h>
+int foo() { return ETH_P_ALL; }
int
main (void)
{
-int foo() { return ETH_P_ALL; }
;
return 0;
}