diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-09-25 13:28:44 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-09-25 13:28:44 +0000 |
commit | da49cbaa093a04c5b13a9e374f4528d95295c9e3 (patch) | |
tree | 5554e5b76ed7a1525a49488426b8618956d3334e /usr.sbin | |
parent | bcb5f96b9a0bee9c23bf4a0d2e8d0d4303a3e8ed (diff) |
When counting the lsa also build the sum of the ls_checksums. This can be
used to quickly verify if two LSDBs are in sync. Other systems do the same.
OK dlg@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospfd/ospfd.h | 4 | ||||
-rw-r--r-- | usr.sbin/ospfd/rde.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/ospfd.h b/usr.sbin/ospfd/ospfd.h index 8b77bf0f99c..400b944fa73 100644 --- a/usr.sbin/ospfd/ospfd.h +++ b/usr.sbin/ospfd/ospfd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfd.h,v 1.87 2010/02/19 10:35:52 dlg Exp $ */ +/* $OpenBSD: ospfd.h,v 1.88 2010/09/25 13:28:43 claudio Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -505,6 +505,7 @@ struct ctl_sum { u_int32_t spf_hold_time; u_int32_t num_ext_lsa; u_int32_t num_area; + u_int32_t ext_lsa_cksum; time_t uptime; u_int8_t rfc1583compat; }; @@ -515,6 +516,7 @@ struct ctl_sum_area { u_int32_t num_adj_nbr; u_int32_t num_spf_calc; u_int32_t num_lsa; + u_int32_t lsa_cksum; }; struct demote_msg { diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index 0d7480cb07f..a6429444c72 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.87 2010/07/19 09:16:30 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.88 2010/09/25 13:28:43 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -794,8 +794,11 @@ rde_send_summary(pid_t pid) LIST_FOREACH(area, &rdeconf->area_list, entry) sumctl.num_area++; - RB_FOREACH(v, lsa_tree, &asext_tree) + RB_FOREACH(v, lsa_tree, &asext_tree) { sumctl.num_ext_lsa++; + sumctl.ext_lsa_cksum += ntohs(v->lsa->hdr.ls_chksum); + + } gettimeofday(&now, NULL); if (rdeconf->uptime < now.tv_sec) @@ -830,8 +833,10 @@ rde_send_summary_area(struct area *area, pid_t pid) if (nbr->state == NBR_STA_FULL && !nbr->self) sumareactl.num_adj_nbr++; - RB_FOREACH(v, lsa_tree, tree) + RB_FOREACH(v, lsa_tree, tree) { sumareactl.num_lsa++; + sumareactl.lsa_cksum += ntohs(v->lsa->hdr.ls_chksum); + } rde_imsg_compose_ospfe(IMSG_CTL_SHOW_SUM_AREA, 0, pid, &sumareactl, sizeof(sumareactl)); |