summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ripd/message.c16
-rw-r--r--usr.sbin/ripd/neighbor.c5
-rw-r--r--usr.sbin/ripd/ripe.h5
3 files changed, 21 insertions, 5 deletions
diff --git a/usr.sbin/ripd/message.c b/usr.sbin/ripd/message.c
index fc1f69b8207..d6705477f30 100644
--- a/usr.sbin/ripd/message.c
+++ b/usr.sbin/ripd/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.4 2006/11/03 15:21:25 michele Exp $ */
+/* $OpenBSD: message.c,v 1.5 2006/11/10 10:28:18 michele Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -60,6 +60,7 @@ start_report_timer(void)
return (evtimer_add(&oeconf->report_timer, &tv));
}
+/* list handlers */
void
add_entry(struct packet_head *r_list, struct rip_route *rr)
{
@@ -83,6 +84,19 @@ delete_entry(struct rip_route *rr)
free(rr);
}
+void
+clear_list(struct packet_head *r_list)
+{
+ struct packet_entry *re;
+
+ while ((re = TAILQ_FIRST(r_list)) != NULL) {
+ TAILQ_REMOVE(r_list, re, entry);
+ delete_entry(re->rr);
+ free(re);
+ }
+}
+
+/* communications */
int
send_triggered_update(struct iface *iface, struct rip_route *rr)
{
diff --git a/usr.sbin/ripd/neighbor.c b/usr.sbin/ripd/neighbor.c
index d35cd1d6055..f583243c12f 100644
--- a/usr.sbin/ripd/neighbor.c
+++ b/usr.sbin/ripd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.3 2006/11/01 20:55:40 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.4 2006/11/10 10:28:18 michele Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -226,7 +226,8 @@ nbr_act_del(struct nbr *nbr)
nbr_stop_timer(nbr);
/* clear lists */
- //response_list_clr(&nbr->rr_list);
+ clear_list(&nbr->rq_list);
+ clear_list(&nbr->rp_list);
LIST_REMOVE(nbr, entry);
LIST_REMOVE(nbr, hash);
diff --git a/usr.sbin/ripd/ripe.h b/usr.sbin/ripd/ripe.h
index b7ef8d9abb6..6e46a94add4 100644
--- a/usr.sbin/ripd/ripe.h
+++ b/usr.sbin/ripd/ripe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripe.h,v 1.2 2006/10/31 23:43:11 michele Exp $ */
+/* $OpenBSD: ripe.h,v 1.3 2006/11/10 10:28:18 michele Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -94,10 +94,11 @@ int if_join_group(struct iface *, struct in_addr *);
int if_leave_group(struct iface *, struct in_addr *);
struct ctl_iface *if_to_ctl(struct iface *);
-/* communications */
+/* message.c */
void recv_request(struct iface *, struct nbr *, char *, u_int16_t);
void recv_response(struct iface *, struct nbr *, char *, u_int16_t);
void add_entry(struct packet_head *, struct rip_route *);
+void clear_list(struct packet_head *);
int send_triggered_update(struct iface *, struct rip_route *);
int send_request(struct packet_head *, struct iface *, struct nbr *);
int send_response(struct packet_head *, struct iface *, struct nbr *);