diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-02-09 15:51:31 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-02-09 15:51:31 +0000 |
commit | 7bf2584a4add39e1a50eb816e09ada80389322a0 (patch) | |
tree | e55b0235916095ef1e76c1af43448d347e25abdf | |
parent | d88da600887a122c8728be80a42a418858471c9e (diff) |
When sending out hellos, copy the bdr and dr addresses into iface->self.
Without this the election process causes strange results as a router that
announces itself as dr/bdr is prefered over one that doesn't.
-rw-r--r-- | usr.sbin/ospfd/hello.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/hello.c b/usr.sbin/ospfd/hello.c index d7f55b58650..eb76310b17f 100644 --- a/usr.sbin/ospfd/hello.c +++ b/usr.sbin/ospfd/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.3 2005/02/07 05:50:59 david Exp $ */ +/* $OpenBSD: hello.c,v 1.4 2005/02/09 15:51:30 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -83,10 +83,14 @@ send_hello(struct iface *iface) hello->rtr_priority = iface->priority; hello->rtr_dead_interval = htonl(iface->dead_interval); - if (iface->dr) + if (iface->dr) { hello->d_rtr = iface->dr->addr.s_addr; - if (iface->bdr) + iface->self->dr.s_addr = iface->dr->addr.s_addr; + } + if (iface->bdr) { hello->bd_rtr = iface->bdr->addr.s_addr; + iface->self->bdr.s_addr = iface->bdr->addr.s_addr; + } ptr += sizeof(*hello); /* active neighbor(s) */ |