diff options
author | 2007-10-16 21:58:17 +0000 | |
---|---|---|
committer | 2007-10-16 21:58:17 +0000 | |
commit | 0545ccbf681f08c6ea5969143132099e6ae9fbf6 (patch) | |
tree | f97cec0bcfd116b0ce76903a8077d17174e88c29 | |
parent | There is not auth code so there is no need for struct crypt. (diff) | |
download | wireguard-openbsd-0545ccbf681f08c6ea5969143132099e6ae9fbf6.tar.xz wireguard-openbsd-0545ccbf681f08c6ea5969143132099e6ae9fbf6.zip |
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.h | 7 | ||||
-rw-r--r-- | usr.sbin/ospf6d/rde_lsdb.c | 5 |
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)); |