Control: tag -1 patch upstream

The build fails due to a trivial naming collision which this patch
fixes.
Description: Resolve naming collision due to libpcap API changes
 dsniff was written with a function named pcap_init() that predates
 the one in libpcap and is entirely different.  This patch renames it
 out of the way.
Author: Dennis Filder <d.fil...@web.de>
Bug-Debian: https://bugs.debian.org/980588
Last-Update: 2021-02-10
---
diff --git dsniff-2.4b1+debian/tcpnice.c dsniff-2.4b1+debian/tcpnice.c
index b0c451e..5a8ce9c 100644
--- dsniff-2.4b1+debian/tcpnice.c
+++ dsniff-2.4b1+debian/tcpnice.c
@@ -204,7 +204,7 @@ main(int argc, char *argv[])

 	filter = copy_argv(argv);

-	if ((pd = pcap_init(intf, filter, 128)) == NULL)
+	if ((pd = pcap_init_dsniff(intf, filter, 128)) == NULL)
 		errx(1, "couldn't initialize sniffing");

 	if ((pcap_off = pcap_dloff(pd)) < 0)
diff --git dsniff-2.4b1+debian/dnsspoof.c dsniff-2.4b1+debian/dnsspoof.c
index 35e0e1c..20b68ec 100644
--- dsniff-2.4b1+debian/dnsspoof.c
+++ dsniff-2.4b1+debian/dnsspoof.c
@@ -309,7 +309,7 @@ main(int argc, char *argv[])
 	else snprintf(buf, sizeof(buf), "udp dst port 53 and not src %s",
 		      libnet_addr2name4(lnet_ip, LIBNET_DONT_RESOLVE));

-	if ((pcap_pd = pcap_init(dev, buf, 128)) == NULL)
+	if ((pcap_pd = pcap_init_dsniff(dev, buf, 128)) == NULL)
 		errx(1, "couldn't initialize sniffing");

 	if ((pcap_off = pcap_dloff(pcap_pd)) < 0)
diff --git dsniff-2.4b1+debian/pcaputil.h dsniff-2.4b1+debian/pcaputil.h
index 8b1bbea..3174ecd 100644
--- dsniff-2.4b1+debian/pcaputil.h
+++ dsniff-2.4b1+debian/pcaputil.h
@@ -11,7 +11,7 @@
 #ifndef PCAPUTIL_H
 #define PCAPUTIL_H

-pcap_t *pcap_init(char *intf, char *filter, int snaplen);
+pcap_t *pcap_init_dsniff(char *intf, char *filter, int snaplen);

 int	pcap_dloff(pcap_t *pd);

diff --git dsniff-2.4b1+debian/tcpkill.c dsniff-2.4b1+debian/tcpkill.c
index 53a4e6b..1a64d40 100644
--- dsniff-2.4b1+debian/tcpkill.c
+++ dsniff-2.4b1+debian/tcpkill.c
@@ -130,7 +130,7 @@ main(int argc, char *argv[])

 	filter = copy_argv(argv);

-	if ((pd = pcap_init(intf, filter, 64)) == NULL)
+	if ((pd = pcap_init_dsniff(intf, filter, 64)) == NULL)
 		errx(1, "couldn't initialize sniffing");

 	if ((pcap_off = pcap_dloff(pd)) < 0)
diff --git dsniff-2.4b1+debian/pcaputil.c dsniff-2.4b1+debian/pcaputil.c
index d06f802..0365a67 100644
--- dsniff-2.4b1+debian/pcaputil.c
+++ dsniff-2.4b1+debian/pcaputil.c
@@ -63,7 +63,7 @@ pcap_dloff(pcap_t *pd)
 }

 pcap_t *
-pcap_init(char *intf, char *filter, int snaplen)
+pcap_init_dsniff(char *intf, char *filter, int snaplen)
 {
 	pcap_t *pd;
 	u_int net, mask;

Reply via email to