summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMunechika SUMIKAWA <sumikawa@FreeBSD.org>2005-05-19 09:28:47 +0000
committerMunechika SUMIKAWA <sumikawa@FreeBSD.org>2005-05-19 09:28:47 +0000
commit0f4b97f92189543d35f9eb21ec25397741bb586f (patch)
tree75dc2e6b1f1fbc9659a9cf3f0b2476d142282315 /net
parentUse MAKE_ARGS (diff)
Fix infinite loop when time got backwards
PR: ports/78302 Submitted by: marck
Notes
Notes: svn path=/head/; revision=135593
Diffstat (limited to 'net')
-rw-r--r--net/zebra/Makefile1
-rw-r--r--net/zebra/files/patch-ospfd_ospf_lsa.c37
2 files changed, 38 insertions, 0 deletions
diff --git a/net/zebra/Makefile b/net/zebra/Makefile
index f1236972a86e..f99cda7a82da 100644
--- a/net/zebra/Makefile
+++ b/net/zebra/Makefile
@@ -7,6 +7,7 @@
PORTNAME= zebra
PORTVERSION= 0.95
+PORTREVISION= 1
CATEGORIES= net ipv6
MASTER_SITES= ftp://ftp.zebra.org/pub/zebra/ \
ftp://ftp.ripe.net/mirrors/sites/ftp.zebra.org/pub/zebra/ \
diff --git a/net/zebra/files/patch-ospfd_ospf_lsa.c b/net/zebra/files/patch-ospfd_ospf_lsa.c
new file mode 100644
index 000000000000..6d55b5316eb9
--- /dev/null
+++ b/net/zebra/files/patch-ospfd_ospf_lsa.c
@@ -0,0 +1,37 @@
+--- ospfd/ospf_lsa.c.orig Mon Feb 28 03:09:10 2005
++++ ospfd/ospf_lsa.c Thu May 19 17:59:09 2005
+@@ -3324,6 +3324,7 @@
+ listnode node;
+ struct ospf *ospf = THREAD_ARG (t);
+ int i;
++ time_t ct;
+ list lsa_to_refresh = list_new ();
+
+ if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
+@@ -3331,15 +3332,25 @@
+
+
+ i = ospf->lsa_refresh_queue.index;
++
++ if ((ct = time(NULL)) < ospf->lsa_refresher_started) {
++ zlog_info ("LSA[Refresh]: ospf_lsa_refresh_walker(): HACK: fixing lsa_refresher_started: %d -> %d", ospf->lsa_refresher_started, ct);
++ ospf->lsa_refresher_started = ct;
++ }
+
+ ospf->lsa_refresh_queue.index =
+ (ospf->lsa_refresh_queue.index +
+- (time (NULL) - ospf->lsa_refresher_started) / OSPF_LSA_REFRESHER_GRANULARITY)
++ (ct - ospf->lsa_refresher_started) / OSPF_LSA_REFRESHER_GRANULARITY)
+ % OSPF_LSA_REFRESHER_SLOTS;
+
+ if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
+ zlog_info ("LSA[Refresh]: ospf_lsa_refresh_walker(): next index %d",
+ ospf->lsa_refresh_queue.index);
++
++ if (ospf->lsa_refresh_queue.index >= OSPF_LSA_REFRESHER_SLOTS) {
++ zlog_info ("LSA[Refresh]: ospf_lsa_refresh_walker(): HACK: fixing index: %hu -> 0", ospf->lsa_refresh_queue.index);
++ ospf->lsa_refresh_queue.index = 0;
++ }
+
+ for (;i != ospf->lsa_refresh_queue.index;
+ i = (i + 1) % OSPF_LSA_REFRESHER_SLOTS)