File: debian.patch

package info (click to toggle)
farpd 0.2-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 416 kB
  • sloc: ansic: 2,646; sh: 449; makefile: 16
file content (238 lines) | stat: -rw-r--r-- 6,878 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
--- farpd-0.2.orig/arpd.8
+++ farpd-0.2/arpd.8
@@ -4,10 +4,10 @@
 .Dd August 4, 2001
 .Dt ARPD 8
 .Sh NAME
-.Nm arpd
+.Nm farpd
 .Nd ARP reply daemon
 .Sh SYNOPSIS
-.Nm arpd
+.Nm farpd
 .Op Fl d
 .Op Fl i Ar interface
 .Op Ar net ...
@@ -31,6 +31,11 @@ LAN for network monitoring or simulation
 .Nm
 exits on an interrupt or termination signal.
 .Pp
+Note: The program name
+.Nm
+has been changed in Debian GNU/Linux from the original name
+(\fBarpd\fR) to avoid name clash with other ARP daemons.
+.Pp
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl d
@@ -52,11 +57,23 @@ Mutiple addresses may be specified.
 .El
 .Sh FILES
 .Bl -tag -width /var/run/arpd.pid
-.It Pa /var/run/arpd.pid
+.It Pa /var/run/farpd.pid
 .El
 .Sh SEE ALSO
 .Xr pcapd 8 ,
 .Xr synackd 8
+.Sh BUGS
+.Nm
+will respond too slowly to ARP requests for some applications. In 
+order to ensure that it does not claim existing IP addresses it will send two
+ARP request and wait for a reply. This slowness affects the \fBnmap\fR network
+scanning tool, and possibly others, which uses by default ARP when scanning
+local networks. The answers from 
+.Nm
+will come after the tool has timeout waiting for the ARP replies and,
+consequently, IP addresses claimed by 
+.Nm 
+will not be discovered.
 .Sh AUTHORS
 Dug Song
 .Aq dugsong@monkey.org ,
--- farpd-0.2.orig/arpd.c
+++ farpd-0.2/arpd.c
@@ -27,13 +27,13 @@
 #undef timeout_initialized
 
 #include <event.h>
-#include <dnet.h>
+#include <dumbnet.h>
 #include "tree.h"
 
 #define ARPD_MAX_ACTIVE		600
 #define ARPD_MAX_INACTIVE	300
 
-#define PIDFILE			"/var/run/arpd.pid"
+#define PIDFILE			"/var/run/farpd.pid"
 
 struct arp_req {
 	struct addr		pa;
@@ -265,7 +265,7 @@ arpd_send(eth_t *eth, int op,
 	    spa->addr_ip, tha->addr_eth, tpa->addr_ip);
 	
 	if (op == ARP_OP_REQUEST) {
-		syslog(LOG_DEBUG, __FUNCTION__ ": who-has %s tell %s",
+		syslog(LOG_DEBUG, "%s: who-has %s tell %s", __func__,
 		    addr_ntoa(tpa), addr_ntoa(spa));
 	} else if (op == ARP_OP_REPLY) {
 		syslog(LOG_INFO, "arp reply %s is-at %s",
@@ -282,7 +282,7 @@ arpd_lookup(struct addr *addr)
 	int error;
 
 	if (addr_cmp(addr, &arpd_ifent.intf_addr) == 0) {
-		syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
+		syslog(LOG_DEBUG, "%s: %s at %s", __func__,
 		    addr_ntoa(addr), addr_ntoa(&arpd_ifent.intf_link_addr));
 		return (0);
 	}
@@ -291,10 +291,10 @@ arpd_lookup(struct addr *addr)
 	error = arp_get(arpd_arp, &arpent);
 	
 	if (error == -1) {
-		syslog(LOG_DEBUG, __FUNCTION__ ": no entry for %s",
+		syslog(LOG_DEBUG, "%s: no entry for %s", __func__,
 		    addr_ntoa(addr));
 	} else {
-		syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
+		syslog(LOG_DEBUG, "%s: %s at %s", __func__,
 		    addr_ntoa(addr), addr_ntoa(&arpent.arp_ha));
 	}
 	return (error);
@@ -315,7 +315,7 @@ arpd_timeout(int fd, short event, void *
 	struct arp_req *req = arg;
 	
 	SPLAY_REMOVE(tree, &arpd_reqs, req);
-	syslog(LOG_DEBUG, "%s: expiring %s",__FUNCTION__, addr_ntoa(&req->pa));
+	syslog(LOG_DEBUG, "%s: expiring %s", __func__, addr_ntoa(&req->pa));
 	arpd_free(req);
 }
 
@@ -400,7 +400,7 @@ arpd_recv_cb(u_char *u, const struct pca
 			
 			if (req->negative) {
 				syslog(LOG_DEBUG, "%s: %s is allocated",
-				    __FUNCTION__, addr_ntoa(&req->pa));
+				    __func__, addr_ntoa(&req->pa));
 				return;
 			}
 
@@ -411,7 +411,7 @@ arpd_recv_cb(u_char *u, const struct pca
 			} else {
 				syslog(LOG_DEBUG,
 				    "%s: %s still discovering (%d)",
-				    __FUNCTION__, addr_ntoa(&req->pa),
+				    __func__, addr_ntoa(&req->pa),
 				    req->cnt);
 			}
 		}
@@ -423,7 +423,7 @@ arpd_recv_cb(u_char *u, const struct pca
 		if ((req = SPLAY_FIND(tree, &arpd_reqs, &tmp)) != NULL) {
 			addr_pack(&src.arp_ha, ADDR_TYPE_ETH, ETH_ADDR_BITS,
 			    ethip->ar_sha, ETH_ADDR_LEN);
-			syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
+			syslog(LOG_DEBUG, "%s: %s at %s", __func__,
 			    addr_ntoa(&req->pa), addr_ntoa(&src.arp_ha));
 			
 			/* This address is claimed */
@@ -445,9 +445,6 @@ arpd_recv(int fd, short type, void *ev)
 void
 terminate_handler(int sig)
 {
-	extern int event_gotsig;
-
-	event_gotsig = 1;
 	arpd_sig = sig;
 }
 
@@ -464,7 +461,6 @@ int
 main(int argc, char *argv[])
 {
 	struct event recv_ev;
-	extern int (*event_sigcb)(void);
 	char *dev;
 	int c, debug;
 	FILE *fp;
@@ -524,7 +520,6 @@ main(int argc, char *argv[])
 		perror("signal");
 		return (-1);
 	}
-	event_sigcb = arpd_signal;
 	
 	event_dispatch();
 
--- farpd-0.2.orig/configure.in
+++ farpd-0.2/configure.in
@@ -19,33 +19,33 @@ dnl Checks for libraries.
 AC_CHECK_LIB(socket, socket)
 AC_CHECK_LIB(nsl, gethostbyname)
 
-dnl Checks for (installed) libdnet
-AC_MSG_CHECKING(for libdnet)
-AC_ARG_WITH(libdnet,
-[  --with-libdnet=DIR      use libdnet in DIR],
+dnl Checks for (installed) libdumbnet
+AC_MSG_CHECKING(for libdumbnet)
+AC_ARG_WITH(libdumbnet,
+[  --with-libdumbnet=DIR      use libdumbnet in DIR],
 [ case "$withval" in
   yes|no)
      AC_MSG_RESULT(no)
      ;;
   *)
      AC_MSG_RESULT($withval)
-     if test -f $withval/src/libdnet.a; then
+     if test -f $withval/src/libdumbnet.a; then
         DNETINC="-I$withval/include"
-        DNETLIB="-L$withval/src -ldnet `$withval/dnet-config --libs`"
-     elif test -x $withval/bin/dnet-config; then
-        DNETINC="`$withval/bin/dnet-config --cflags`"
-        DNETLIB="`$withval/bin/dnet-config --libs`"
+        DNETLIB="-L$withval/src -ldumbnet `$withval/dumbnet-config --libs`"
+     elif test -x $withval/bin/dumbnet-config; then
+        DNETINC="`$withval/bin/dumbnet-config --cflags`"
+        DNETLIB="`$withval/bin/dumbnet-config --libs`"
      else
-        AC_ERROR(dnet-config not found in $withval/bin)
+        AC_ERROR(dumbnet-config not found in $withval/bin)
      fi
      ;;
   esac ],
-[ if test -x ${prefix}/bin/dnet-config; then
-     DNETINC="`${prefix}/bin/dnet-config --cflags`"
-     DNETLIB="`${prefix}/bin/dnet-config --libs`"
+[ if test -x ${prefix}/bin/dumbnet-config; then
+     DNETINC="`${prefix}/bin/dumbnet-config --cflags`"
+     DNETLIB="`${prefix}/bin/dumbnet-config --libs`"
   else
      AC_MSG_RESULT(no)
-     AC_ERROR(libdnet not found)
+     AC_ERROR(libdumbnet not found)
   fi
   AC_MSG_RESULT(yes) ]
 )
@@ -77,7 +77,7 @@ AC_ARG_WITH(libevent,
      fi
      ;;
   esac ],
-[ if test -f ${prefix}/include/event.h -a -f ${prefix}/lib/libevent.a;
+[ if test -f ${prefix}/include/event.h;
 then
      EVENTINC="-I${prefix}/include"
      EVENTLIB="-L${prefix}/lib -levent"
@@ -161,12 +161,12 @@ AC_REPLACE_FUNCS(daemon)
 CFLAGS=$DNETINC
 LIBS=$DNETLIB
 
-dnl see if dnet works
-        AC_MSG_CHECKING(for working addr_cmp in libdnet)
+dnl see if dumbnet works
+        AC_MSG_CHECKING(for working addr_cmp in libdumbnet)
         AC_TRY_RUN(
 #include <sys/types.h>
 #include <stdlib.h>
-#include <dnet.h>
+#include <dumbnet.h>
 int
 main(int argc, char **argv)
 {