summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d/rde_lsdb.c
diff options
context:
space:
mode:
authorEsben Norby <norby@cvs.openbsd.org>2007-10-16 12:05:53 +0000
committerEsben Norby <norby@cvs.openbsd.org>2007-10-16 12:05:53 +0000
commitc93bdde023fd7cec6281f07300d05bfe92b7c888 (patch)
tree8bc389ceb0cf1efcc461fb6952b482771ba88a1d /usr.sbin/ospf6d/rde_lsdb.c
parentd20466bc45a7f5f50f9d059f77420fbaa5298f27 (diff)
In OSPFv3 the LSA type is a 16 bit value, furthermore it uses different
values than the v2 counterpart. Change to u_int16_t and define new LSA types. ok claudio@
Diffstat (limited to 'usr.sbin/ospf6d/rde_lsdb.c')
-rw-r--r--usr.sbin/ospf6d/rde_lsdb.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/usr.sbin/ospf6d/rde_lsdb.c b/usr.sbin/ospf6d/rde_lsdb.c
index 70c23652f16..92193453768 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.1 2007/10/08 10:44:51 norby Exp $ */
+/* $OpenBSD: rde_lsdb.c,v 1.2 2007/10/16 12:05:52 norby Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -185,7 +185,10 @@ lsa_check(struct rde_nbr *nbr, struct lsa *lsa, u_int16_t len)
return (0);
}
- switch (lsa->hdr.type) {
+ switch (ntohs(lsa->hdr.type)) {
+ case LSA_TYPE_LINK:
+ /* XXX */
+ break;
case LSA_TYPE_ROUTER:
if (!lsa_router_check(lsa, len))
return (0);
@@ -197,8 +200,8 @@ lsa_check(struct rde_nbr *nbr, struct lsa *lsa, u_int16_t len)
return (0);
}
break;
- case LSA_TYPE_SUM_NETWORK:
- case LSA_TYPE_SUM_ROUTER:
+ case LSA_TYPE_INTER_A_PREFIX:
+ case LSA_TYPE_INTER_A_ROUTER:
if ((len % sizeof(u_int32_t)) ||
len < sizeof(lsa->hdr) + sizeof(lsa->data.sum)) {
log_warnx("lsa_check: bad LSA summary packet");
@@ -210,6 +213,9 @@ lsa_check(struct rde_nbr *nbr, struct lsa *lsa, u_int16_t len)
return (0);
}
break;
+ case LSA_TYPE_INTRA_A_PREFIX:
+ /* XXX */
+ break;
case LSA_TYPE_EXTERNAL:
if ((len % (3 * sizeof(u_int32_t))) ||
len < sizeof(lsa->hdr) + sizeof(lsa->data.asext)) {
@@ -436,7 +442,7 @@ lsa_age(struct vertex *v)
}
struct vertex *
-lsa_find(struct area *area, u_int8_t type, u_int32_t ls_id, u_int32_t adv_rtr)
+lsa_find(struct area *area, u_int16_t type, u_int32_t ls_id, u_int32_t adv_rtr)
{
struct vertex key;
struct vertex *v;
@@ -555,11 +561,11 @@ lsa_dump(struct lsa_tree *tree, int imsg_type, pid_t pid)
break;
continue;
case IMSG_CTL_SHOW_DB_SUM:
- if (v->type == LSA_TYPE_SUM_NETWORK)
+ if (v->type == LSA_TYPE_INTER_A_PREFIX)
break;
continue;
case IMSG_CTL_SHOW_DB_ASBR:
- if (v->type == LSA_TYPE_SUM_ROUTER)
+ if (v->type == LSA_TYPE_INTER_A_ROUTER)
break;
continue;
default:
@@ -700,8 +706,8 @@ lsa_remove_invalid_sums(struct area *area)
/* XXX speed me up */
for (v = RB_MIN(lsa_tree, tree); v != NULL; v = nv) {
nv = RB_NEXT(lsa_tree, tree, v);
- if ((v->lsa->hdr.type == LSA_TYPE_SUM_NETWORK ||
- v->lsa->hdr.type == LSA_TYPE_SUM_ROUTER) &&
+ if ((v->lsa->hdr.type == LSA_TYPE_INTER_A_PREFIX ||
+ v->lsa->hdr.type == LSA_TYPE_INTER_A_ROUTER) &&
v->self && v->cost == LS_INFINITY &&
v->deleted == 0) {
/*