Package: netkit-rwho / 0.17-13

show_in_all_ifaces.patch Patch series | download
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
Description: Fix rwhod not broadcasting on all interfaces
Origin: https://bugzilla.redhat.com/show_bug.cgi?id=708385
Author: Ian Donaldson
Bug-Debian: http://bugs.debian.org/707253
--- netkit-rwho-0.17.orig/rwhod/rwhod.c.orig	2013-05-08 11:31:08.000000000 -0400
+++ netkit-rwho-0.17.orig/rwhod/rwhod.c	2013-05-08 11:33:02.000000000 -0400
@@ -439,6 +439,8 @@
 	getboottime(&mywd);
 
 	while (1) {
+		if (!configure(sk))
+			exit(1);
 		sendpacket(&mywd);
 		(void) sleep(AL_INTERVAL);
 	}
@@ -663,6 +665,20 @@
 	register struct neighbor *np;
 	struct wanted_neigh *wn;
 
+	/* forget previous neighbors; interfaces may have changed */
+	for (np = neighbors; np != NULL; ) {
+		register struct neighbor *pp;
+
+		if(np->n_name)
+			free(np->n_name);
+		if(np->n_myaddr)
+			free(np->n_myaddr);
+		pp = np;
+		np = np->n_next;
+		free((char *)pp);
+	}
+	neighbors = 0;
+
 	ifc.ifc_len = sizeof (buf);
 	ifc.ifc_buf = buf;
 	if (ioctl(s, SIOCGIFCONF, &ifc) < 0) {