diff options
-rw-r--r-- | usr.sbin/dvmrpd/dvmrpd.h | 4 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/interface.c | 3 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/rde.c | 40 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/rde.h | 3 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/rde_srt.c | 15 |
5 files changed, 11 insertions, 54 deletions
diff --git a/usr.sbin/dvmrpd/dvmrpd.h b/usr.sbin/dvmrpd/dvmrpd.h index 5a7e5df4eca..f8f7d8a9f4f 100644 --- a/usr.sbin/dvmrpd/dvmrpd.h +++ b/usr.sbin/dvmrpd/dvmrpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dvmrpd.h,v 1.12 2009/01/19 20:40:31 michele Exp $ */ +/* $OpenBSD: dvmrpd.h,v 1.13 2009/01/20 01:35:34 todd Exp $ */ /* * Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org> @@ -234,6 +234,7 @@ struct iface { int fd; int state; int mtu; + int nbr_cnt; int adj_cnt; u_int16_t flags; @@ -322,6 +323,7 @@ struct ctl_iface { unsigned int ifindex; int state; int mtu; + int nbr_cnt; int adj_cnt; u_int16_t flags; diff --git a/usr.sbin/dvmrpd/interface.c b/usr.sbin/dvmrpd/interface.c index 3b3202bd14b..492dfbbff11 100644 --- a/usr.sbin/dvmrpd/interface.c +++ b/usr.sbin/dvmrpd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.6 2009/01/19 20:40:31 michele Exp $ */ +/* $OpenBSD: interface.c,v 1.7 2009/01/20 01:35:34 todd Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -643,6 +643,7 @@ if_to_ctl(struct iface *iface) ictl.ifindex = iface->ifindex; ictl.state = iface->state; ictl.mtu = iface->mtu; + ictl.nbr_cnt = iface->nbr_cnt; ictl.adj_cnt = iface->adj_cnt; ictl.gen_id = iface->gen_id; diff --git a/usr.sbin/dvmrpd/rde.c b/usr.sbin/dvmrpd/rde.c index 1c9be751935..eae0467f5db 100644 --- a/usr.sbin/dvmrpd/rde.c +++ b/usr.sbin/dvmrpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.7 2009/01/19 20:40:31 michele Exp $ */ +/* $OpenBSD: rde.c,v 1.8 2009/01/20 01:35:34 todd Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -39,8 +39,6 @@ #include "log.h" #include "rde.h" -void rde_ds_iface(struct mfc *, struct iface *, struct rt_node *); - void rde_nbr_init(u_int32_t); void rde_nbr_free(void); struct rde_nbr *rde_nbr_find(u_int32_t); @@ -200,7 +198,6 @@ rde_dispatch_imsg(int fd, short event, void *bula) struct imsg imsg; struct route_report rr; struct rde_nbr rn; - struct rt_node *r; int i, n, connected = 0; struct iface *iface; @@ -263,16 +260,11 @@ rde_dispatch_imsg(int fd, short event, void *bula) for (i = 0; i < MAXVIFS; i++) mfc.ttls[i] = 0; - r = rt_matchorigin(mfc.origin.s_addr); - if (r == NULL) { - log_debug("rde_dispatch_imsg: " - "packet from unknown origin"); - break; + LIST_FOREACH(iface, &rdeconf->iface_list, entry) { + if (mfc.ifindex != iface->ifindex) + mfc.ttls[iface->ifindex] = 1; } - LIST_FOREACH(iface, &rdeconf->iface_list, entry) - rde_ds_iface(&mfc, iface, r); - mfc_update(&mfc); #endif break; @@ -307,30 +299,6 @@ rde_dispatch_imsg(int fd, short event, void *bula) imsg_event_add(ibuf); } -/* 1) Add interfaces with downstream routers for this - source. - 2) Add interfaces with member for this group if i am - the designated forwarder. -*/ -void -rde_ds_iface(struct mfc *mfc, struct iface *iface, struct rt_node *r) -{ - if (mfc->ifindex == iface->ifindex) { - return; - } - - if (r->ds_cnt[iface->ifindex] != 0) { - mfc->ttls[iface->ifindex] = 1; - return; - } - - if (group_list_find(iface, mfc->group.s_addr) && - r->adv_rtr[iface->ifindex].addr.s_addr == iface->addr.s_addr) { - mfc->ttls[iface->ifindex] = 1; - return; - } -} - LIST_HEAD(rde_nbr_head, rde_nbr); struct nbr_table { diff --git a/usr.sbin/dvmrpd/rde.h b/usr.sbin/dvmrpd/rde.h index 29c7bf95ecf..77c7b38d654 100644 --- a/usr.sbin/dvmrpd/rde.h +++ b/usr.sbin/dvmrpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.8 2009/01/19 20:40:31 michele Exp $ */ +/* $OpenBSD: rde.h,v 1.9 2009/01/20 01:35:34 todd Exp $ */ /* * Copyright (c) 2005, 2006 Esben Norby <norby@openbsd.org> @@ -96,7 +96,6 @@ void mfc_delete(struct mfc *); void rt_init(void); int rt_compare(struct rt_node *, struct rt_node *); struct rt_node *rt_find(in_addr_t, u_int8_t); -struct rt_node *rt_matchorigin(in_addr_t); struct rt_node *rr_new_rt(struct route_report *, u_int32_t, int); int rt_insert(struct rt_node *); void rt_update(struct rt_node *); diff --git a/usr.sbin/dvmrpd/rde_srt.c b/usr.sbin/dvmrpd/rde_srt.c index 0f2a81b2be0..c0b08498ece 100644 --- a/usr.sbin/dvmrpd/rde_srt.c +++ b/usr.sbin/dvmrpd/rde_srt.c @@ -1,7 +1,6 @@ -/* $OpenBSD: rde_srt.c,v 1.14 2009/01/19 20:52:09 michele Exp $ */ +/* $OpenBSD: rde_srt.c,v 1.15 2009/01/20 01:35:34 todd Exp $ */ /* - * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> * Copyright (c) 2005, 2006 Esben Norby <norby@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any @@ -163,18 +162,6 @@ rt_find(in_addr_t prefix, u_int8_t prefixlen) } struct rt_node * -rt_matchorigin(in_addr_t src) -{ - struct rt_node *r; - - RB_FOREACH(r, rt_tree, &rt) - if (r->prefix.s_addr == (src & prefixlen2mask(r->prefixlen))) - return (r); - - return (NULL); -} - -struct rt_node * rr_new_rt(struct route_report *rr, u_int32_t adj_metric, int connected) { struct timespec now; |