--- rwhod.c.orig	2013-05-08 11:31:08.000000000 -0400
+++ 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_addr)
+			free(np->n_addr);
+		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) {
