Files
passivedns/128.patch
Martin Hauke 21d3f9806d - Add patches:
* https://patch-diff.githubusercontent.com/raw/gamelinux/passivedns/pull/128.patch
  * 0001-Fix-compiler-warning-about-excessive-parenthesis.patch
  * 0002-Add-support-for-loopback-devices.patch
  * 0003-Declare-signal_reopen_log_files-as-a-sig_atomic_t.patch
  * 0001-Added-patch-for-GCC-10-by-acoul.patch

OBS-URL: https://build.opensuse.org/package/show/home:mnhauke:security/passivedns?expand=0&rev=5
2022-10-05 19:03:10 +00:00

32 lines
1.1 KiB
Diff

From 166d872d9ec681a8cd0e915edccbd856e5060553 Mon Sep 17 00:00:00 2001
From: Chris Kuethe <chris.kuethe@gmail.com>
Date: Tue, 4 Oct 2022 11:44:20 -0700
Subject: [PATCH] Apparently `pcap_lookupdev` is deprecated
---
src/passivedns.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/passivedns.c b/src/passivedns.c
index eb080b0..ced6587 100644
--- a/src/passivedns.c
+++ b/src/passivedns.c
@@ -1520,8 +1520,15 @@ int main(int argc, char *argv[])
}
else {
/* Look up an available device if non specified */
- if (config.dev == 0x0)
- config.dev = pcap_lookupdev(config.errbuf);
+ if (config.dev == 0x0) {
+ pcap_if_t *alldevs;
+ if (0 != pcap_findalldevs(&alldevs, config.errbuf)) {
+ elog("[*] Error pcap_findalldevs: %s \n", config.errbuf);
+ exit(1);
+ }
+ config.dev = strdup(alldevs[0].name);
+ pcap_freealldevs(alldevs);
+ }
olog("[*] Device: %s\n", config.dev);
if ((config.handle = pcap_open_live(config.dev, SNAPLENGTH, config.promisc, 500,