Commit Diff
Diff:
0240ea1bae04474c4c92969de0cc32a2073f9cd3
f6fb606b0ebf42cb8c2566e471014b24764abefe
Commit:
f6fb606b0ebf42cb8c2566e471014b24764abefe
Tree:
9549e2abbcf527c2ab3ff0b0f6e64fafed7a5c67
Author:
pbug <pbug@delphinusdns.org>
Committer:
pbug <pbug@delphinusdns.org>
Date:
Sat Mar 13 20:20:44 2010 UTC
Message:
* when updating the record make sure it worked, I'd rather have a ns server in an infinite loop than give out bogus answers (NOERROR) which happened this morning, not sure how that could have happened either.
blob - cb134eb4a855f259b0fd92835370a67522326f7d
blob + a7196518bfd38fe66e692518a197b45a7f3df03d
--- reply.c
+++ reply.c
@@ -49,7 +49,7 @@ extern int additional_ptr(char *, int, struct domain *
void update_db(DB *, struct domain *);
-static const char rcsid[] = "$Id: reply.c,v 1.13 2010/03/12 21:11:27 pbug Exp $";
+static const char rcsid[] = "$Id: reply.c,v 1.14 2010/03/13 20:20:44 pbug Exp $";
/*
* REPLY_A() - replies a DNS question (*q) on socket (so)
@@ -1711,19 +1711,24 @@ update_db(DB *db, struct domain *sd)
DBT key, data;
- memset(&key, 0, sizeof(key));
- memset(&data, 0, sizeof(data));
+ do {
+ memset(&key, 0, sizeof(key));
+ memset(&data, 0, sizeof(data));
- key.data = sd->zone;
- key.size = sd->zonelen;
+ key.data = sd->zone;
+ key.size = sd->zonelen;
- data.data = (char *)sd;
- data.size = sizeof(struct domain);
-
-#if DB_VERSION_MAJOR > 3
- /* XXX */
- ret = db->put(db, NULL, &key, &data, 0);
-#else
- ret = db->put(db, &key, &data, 0) ;
-#endif
+ data.data = (char *)sd;
+ data.size = sizeof(struct domain);
+
+ #if DB_VERSION_MAJOR > 3
+ /* XXX */
+ ret = db->put(db, NULL, &key, &data, 0);
+ #else
+ ret = db->put(db, &key, &data, 0) ;
+ #endif
+
+ } while (ret != 0);
+
+ return;
}
repomaster@centroid.eu