iputils/iputils-ss021109-rdisc-server.patch

45 lines
1.1 KiB
Diff

--- iputils/rdisc.c
+++ iputils/rdisc.c
@@ -63,6 +63,8 @@
#include "SNAPSHOT.h"
+#define RDISC_SERVER
+
struct interface
{
struct in_addr address; /* Used to identify the interface */
@@ -163,11 +165,8 @@
int debugfile;
char usage[] =
-"Usage: rdisc [-b] [-d] [-s] [-v] [-f] [-a] [-V] [send_address] [receive_address]\n"
-#ifdef RDISC_SERVER
-" rdisc -r [-b] [-d] [-s] [-v] [-f] [-a] [-V] [-p <preference>] [-T <secs>] \n"
-" [send_address] [receive_address]\n"
-#endif
+"Usage: rdisc -r [-b] [-d] [-s] [-v] [-f] [-a] [-V] [-p <preference>] [-T <secs>] \n"
+" [send_address] [receive_address]\n"
;
@@ -875,7 +874,9 @@
((max_adv_int - min_adv_int)
* (random() % 1000)/1000);
} else {
- if (!is_directly_connected(ip->saddr)) {
+ struct in_addr tmp;
+ tmp.s_addr = ip->saddr;
+ if (!is_directly_connected(tmp)) {
if (verbose)
logtrace("ICMP %s from %s: source not directly connected\n",
pr_type((int)icp->type),
@@ -945,7 +946,6 @@
{
#ifdef RDISC_SERVER
if (responder) {
- int i;
/* Send out a packet with a preference so that all
* hosts will know that we are dead.