summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-10-16 21:58:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-10-16 21:58:18 +0000
commitb287365685674a9564352a814d55b4a16440f3d2 (patch)
tree505ad1f6596a6e79bd0304c0a3147ec31b7fbfd2
parent91348d209f77f8602a7d17c2f8cc7258de42eb16 (diff)
Make struct lsa_rtr a better match of the reality. Still not happy because
some people had the great idea to make the OSPF options 24bits. Still undecided if a u_int32_t should be used or 4 u_int8_t both is gross.
-rw-r--r--usr.sbin/ospf6d/ospf6.h7
-rw-r--r--usr.sbin/ospf6d/rde_lsdb.c5
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ospf6d/ospf6.h b/usr.sbin/ospf6d/ospf6.h
index 032b4d0ac1a..2a5deb5f77f 100644
--- a/usr.sbin/ospf6d/ospf6.h
+++ b/usr.sbin/ospf6d/ospf6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospf6.h,v 1.6 2007/10/16 21:44:41 claudio Exp $ */
+/* $OpenBSD: ospf6.h,v 1.7 2007/10/16 21:58:17 claudio Exp $ */
/*
* Copyright (c) 2004, 2005, 2007 Esben Norby <norby@openbsd.org>
@@ -174,11 +174,10 @@ struct ls_upd_hdr {
#define OSPF_RTR_B 0x01
#define OSPF_RTR_E 0x02
#define OSPF_RTR_V 0x04
+#define OSPF_RTR_W 0x08
struct lsa_rtr {
- u_int8_t flags;
- u_int8_t dummy;
- u_int16_t nlinks;
+ u_int32_t opts; /* 8bit flags + 24bits options */
};
struct lsa_rtr_link {
diff --git a/usr.sbin/ospf6d/rde_lsdb.c b/usr.sbin/ospf6d/rde_lsdb.c
index 388eafeeb4d..5f5d64ef62c 100644
--- a/usr.sbin/ospf6d/rde_lsdb.c
+++ b/usr.sbin/ospf6d/rde_lsdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_lsdb.c,v 1.4 2007/10/16 21:02:26 claudio Exp $ */
+/* $OpenBSD: rde_lsdb.c,v 1.5 2007/10/16 21:58:17 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -492,7 +492,8 @@ lsa_num_links(struct vertex *v)
{
switch (v->type) {
case LSA_TYPE_ROUTER:
- return (ntohs(v->lsa->data.rtr.nlinks));
+ return ((ntohs(v->lsa->hdr.len) - sizeof(struct lsa_hdr)
+ - sizeof(u_int32_t)) / sizeof(struct lsa_rtr_link));
case LSA_TYPE_NETWORK:
return ((ntohs(v->lsa->hdr.len) - sizeof(struct lsa_hdr)
- sizeof(u_int32_t)) / sizeof(struct lsa_net_link));