summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2009-03-29 16:24:39 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2009-03-29 16:24:39 +0000
commit219278b23d55767a19508bfbf816a59aff614d25 (patch)
tree639db3b15c5c21085b0ecbfe95b1732008d0f0e3 /usr.sbin/ospf6d
parent7f8936dfefde2990fdc4f7df55757f3394a9fb8d (diff)
For SPF calculation, we will need the source address specified
in hello packets by next-hop neighbours. So when notifying the RDE of a new neighbour, send the source address, too. ok claudio@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/hello.c4
-rw-r--r--usr.sbin/ospf6d/interface.c5
-rw-r--r--usr.sbin/ospf6d/neighbor.c7
-rw-r--r--usr.sbin/ospf6d/ospfe.h5
-rw-r--r--usr.sbin/ospf6d/rde.h3
5 files changed, 15 insertions, 9 deletions
diff --git a/usr.sbin/ospf6d/hello.c b/usr.sbin/ospf6d/hello.c
index f5c92d39019..d9b2961ff67 100644
--- a/usr.sbin/ospf6d/hello.c
+++ b/usr.sbin/ospf6d/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.13 2009/01/27 21:58:28 stsp Exp $ */
+/* $OpenBSD: hello.c,v 1.14 2009/03/29 16:24:38 stsp Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -169,7 +169,7 @@ recv_hello(struct iface *iface, struct in6_addr *src, u_int32_t rtr_id,
}
if (!nbr) {
- nbr = nbr_new(rtr_id, iface, ntohl(hello.iface_id), 0);
+ nbr = nbr_new(rtr_id, iface, ntohl(hello.iface_id), 0, src);
/* set neighbor parameters */
nbr->dr.s_addr = hello.d_rtr;
nbr->bdr.s_addr = hello.bd_rtr;
diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c
index 09d76ad4e96..ccbc66e531f 100644
--- a/usr.sbin/ospf6d/interface.c
+++ b/usr.sbin/ospf6d/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.13 2009/02/19 22:08:14 stsp Exp $ */
+/* $OpenBSD: interface.c,v 1.14 2009/03/29 16:24:38 stsp Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -280,7 +280,8 @@ void
if_start(struct ospfd_conf *xconf, struct iface *iface)
{
/* init the dummy local neighbor */
- iface->self = nbr_new(ospfe_router_id(), iface, iface->ifindex, 1);
+ iface->self = nbr_new(ospfe_router_id(), iface, iface->ifindex, 1,
+ NULL);
/* set event handlers for interface */
evtimer_set(&iface->lsack_tx_timer, ls_ack_tx_timer, iface);
diff --git a/usr.sbin/ospf6d/neighbor.c b/usr.sbin/ospf6d/neighbor.c
index 3ab2126052f..b4d0cfa7da9 100644
--- a/usr.sbin/ospf6d/neighbor.c
+++ b/usr.sbin/ospf6d/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.10 2009/02/19 22:02:59 stsp Exp $ */
+/* $OpenBSD: neighbor.c,v 1.11 2009/03/29 16:24:38 stsp Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -269,7 +269,8 @@ nbr_init(u_int32_t hashsize)
}
struct nbr *
-nbr_new(u_int32_t nbr_id, struct iface *iface, u_int32_t iface_id, int self)
+nbr_new(u_int32_t nbr_id, struct iface *iface, u_int32_t iface_id, int self,
+ struct in6_addr *addr)
{
struct nbr_head *head;
struct nbr *nbr;
@@ -315,6 +316,8 @@ nbr_new(u_int32_t nbr_id, struct iface *iface, u_int32_t iface_id, int self)
evtimer_set(&nbr->adj_timer, nbr_adj_timer, nbr);
bzero(&rn, sizeof(rn));
+ if (addr)
+ rn.addr = *addr;
rn.id.s_addr = nbr->id.s_addr;
rn.area_id.s_addr = nbr->iface->area_id.s_addr;
rn.ifindex = nbr->iface->ifindex;
diff --git a/usr.sbin/ospf6d/ospfe.h b/usr.sbin/ospf6d/ospfe.h
index 41f099c8ff0..ef99a587f57 100644
--- a/usr.sbin/ospf6d/ospfe.h
+++ b/usr.sbin/ospf6d/ospfe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.h,v 1.14 2009/02/19 22:08:14 stsp Exp $ */
+/* $OpenBSD: ospfe.h,v 1.15 2009/03/29 16:24:38 stsp Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -192,7 +192,8 @@ void lsa_cache_put(struct lsa_ref *, struct nbr *);
/* neighbor.c */
void nbr_init(u_int32_t);
-struct nbr *nbr_new(u_int32_t, struct iface *, u_int32_t, int);
+struct nbr *nbr_new(u_int32_t, struct iface *, u_int32_t, int,
+ struct in6_addr *);
void nbr_del(struct nbr *);
struct nbr *nbr_find_id(struct iface *, u_int32_t);
diff --git a/usr.sbin/ospf6d/rde.h b/usr.sbin/ospf6d/rde.h
index cc9aa669a40..7d3e3349200 100644
--- a/usr.sbin/ospf6d/rde.h
+++ b/usr.sbin/ospf6d/rde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.h,v 1.11 2009/03/12 01:21:49 stsp Exp $ */
+/* $OpenBSD: rde.h,v 1.12 2009/03/29 16:24:38 stsp Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -64,6 +64,7 @@ struct rde_req_entry {
/* just the info RDE needs */
struct rde_nbr {
LIST_ENTRY(rde_nbr) entry, hash;
+ struct in6_addr addr;
struct in_addr id;
struct in_addr area_id;
TAILQ_HEAD(, rde_req_entry) req_list;