summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authordenis <denis@cvs.openbsd.org>2020-01-21 15:17:14 +0000
committerdenis <denis@cvs.openbsd.org>2020-01-21 15:17:14 +0000
commite9fcad406e5a9de710a1f2f452e67788ddec9282 (patch)
tree0bd6b5230c366ed8d148a09f60494f5ee2f3a838 /usr.sbin/ospf6d
parent665125556252d0d26001c74d0d476684edbe989a (diff)
No need to pass peerid to lsa_snap()
OK remi@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/rde.c4
-rw-r--r--usr.sbin/ospf6d/rde.h4
-rw-r--r--usr.sbin/ospf6d/rde_lsdb.c17
3 files changed, 13 insertions, 12 deletions
diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c
index 50acfa416f7..de193ff75a4 100644
--- a/usr.sbin/ospf6d/rde.c
+++ b/usr.sbin/ospf6d/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.82 2020/01/02 10:16:46 denis Exp $ */
+/* $OpenBSD: rde.c,v 1.83 2020/01/21 15:17:12 denis Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -345,7 +345,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
if (nbr == NULL)
break;
- lsa_snap(nbr, imsg.hdr.peerid);
+ lsa_snap(nbr);
imsg_compose_event(iev_ospfe, IMSG_DB_END, imsg.hdr.peerid,
0, -1, NULL, 0);
diff --git a/usr.sbin/ospf6d/rde.h b/usr.sbin/ospf6d/rde.h
index ca7d403c0a1..6c0604be264 100644
--- a/usr.sbin/ospf6d/rde.h
+++ b/usr.sbin/ospf6d/rde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.h,v 1.23 2019/12/22 11:19:06 denis Exp $ */
+/* $OpenBSD: rde.h,v 1.24 2020/01/21 15:17:12 denis Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -159,7 +159,7 @@ struct vertex *lsa_find_tree(struct lsa_tree *, u_int16_t, u_int32_t,
u_int32_t lsa_find_lsid(struct lsa_tree *, u_int16_t, u_int32_t,
int (*)(struct lsa *, struct lsa *), struct lsa *);
u_int16_t lsa_num_links(struct vertex *);
-void lsa_snap(struct rde_nbr *, u_int32_t);
+void lsa_snap(struct rde_nbr *);
void lsa_dump(struct lsa_tree *, int, pid_t);
void lsa_merge(struct rde_nbr *, struct lsa *, struct vertex *);
void lsa_remove_invalid_sums(struct area *);
diff --git a/usr.sbin/ospf6d/rde_lsdb.c b/usr.sbin/ospf6d/rde_lsdb.c
index 3326c1e90cf..a44d6554758 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.41 2020/01/02 10:16:46 denis Exp $ */
+/* $OpenBSD: rde_lsdb.c,v 1.42 2020/01/21 15:17:13 denis Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -39,8 +39,6 @@ int lsa_get_prefix(void *, u_int16_t, struct rt_prefix *);
RB_GENERATE(lsa_tree, vertex, entry, lsa_compare)
-extern struct ospfd_conf *rdeconf;
-
void
lsa_init(struct lsa_tree *t)
{
@@ -235,6 +233,7 @@ lsa_check(struct rde_nbr *nbr, struct lsa *lsa, u_int16_t len)
case LSA_TYPE_NETWORK:
if ((len % sizeof(u_int32_t)) ||
len < sizeof(lsa->hdr) + sizeof(u_int32_t)) {
+ log_warnx("lsa_check: bad LSA network packet");
return (0);
}
break;
@@ -716,7 +715,7 @@ lsa_num_links(struct vertex *v)
}
void
-lsa_snap(struct rde_nbr *nbr, u_int32_t peerid)
+lsa_snap(struct rde_nbr *nbr)
{
struct lsa_tree *tree = &nbr->area->lsa_tree;
struct vertex *v;
@@ -727,11 +726,13 @@ lsa_snap(struct rde_nbr *nbr, u_int32_t peerid)
continue;
lsa_age(v);
if (ntohs(v->lsa->hdr.age) >= MAX_AGE) {
- rde_imsg_compose_ospfe(IMSG_LS_SNAP, peerid,
- 0, &v->lsa->hdr, ntohs(v->lsa->hdr.len));
+ rde_imsg_compose_ospfe(IMSG_LS_SNAP,
+ nbr->peerid, 0, &v->lsa->hdr,
+ ntohs(v->lsa->hdr.len));
} else {
- rde_imsg_compose_ospfe(IMSG_DB_SNAPSHOT, peerid,
- 0, &v->lsa->hdr, sizeof(struct lsa_hdr));
+ rde_imsg_compose_ospfe(IMSG_DB_SNAPSHOT,
+ nbr->peerid, 0, &v->lsa->hdr,
+ sizeof(struct lsa_hdr));
}
}
if (tree == &asext_tree)