Skip to content

Commit

Permalink
fixed a few long tests
Browse files Browse the repository at this point in the history
ran ./do-tests
meld



git-svn-id: file:///svn/nsd/trunk@2739 a26ef69c-88ff-0310-839f-98b793d9c207
  • Loading branch information
Matthijs Mekking committed Jun 12, 2008
1 parent d1e7421 commit 25c82bb
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 32 deletions.
13 changes: 4 additions & 9 deletions difffile.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,13 @@ rdatas_equal(rdata_atom_type *a, rdata_atom_type *b, int num, uint16_t type)
{
if(rdata_atom_is_domain(type, k)) {
/* check dname: should compare case insensitive */
if(dname_compare(domain_dname(a[k].domain), domain_dname(b[k].domain))!=0)
if(dname_compare(domain_dname(a[k].domain),
domain_dname(b[k].domain))!=0)
return 0;
} else {
/* check length */
if(a[k].data[0] != b[k].data[0])
return 0;

/* check data */
if(memcmp(a[k].data+1, b[k].data+1, a[k].data[0])!=0)
return 0;
Expand Down Expand Up @@ -352,7 +352,7 @@ find_rr_num(rrset_type* rrset,

static int
delete_RR(namedb_type* db, const dname_type* dname,
uint16_t type, uint16_t klass, uint32_t ttl,
uint16_t type, uint16_t klass,
buffer_type* packet, size_t rdatalen, zone_type *zone,
region_type* temp_region)
{
Expand Down Expand Up @@ -393,15 +393,10 @@ delete_RR(namedb_type* db, const dname_type* dname,
}
if(rrset->rr_count == 1) {
/* delete entire rrset */
log_msg(LOG_WARNING, "diff: delete whole rrset %s",
dname_to_string(dname,0));
rrset_delete(db, domain, rrset);
} else {
/* swap out the bad RR and decrease the count */
rr_type* rrs_orig = rrset->rrs;

log_msg(LOG_WARNING, "diff: delete bad RRs %s",
dname_to_string(dname,0));
add_rdata_to_recyclebin(db, &rrset->rrs[rrnum]);
if(rrnum < rrset->rr_count-1)
rrset->rrs[rrnum] = rrset->rrs[rrset->rr_count-1];
Expand Down Expand Up @@ -869,7 +864,7 @@ apply_ixfr(namedb_type* db, FILE *in, const off_t* startpos,
&& seq_nr == seq_total-1) {
continue; /* do not delete final SOA RR for IXFR */
}
if(!delete_RR(db, dname, type, klass, ttl, packet,
if(!delete_RR(db, dname, type, klass, packet,
rrlen, zone_db, region))
return 0;
}
Expand Down
10 changes: 8 additions & 2 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
9 June 2008: Matthijs
- When comparing RRs, do not compare TTL values (since the same record
with different TTL values are considered equal).
- Fixup some more unaligned memory access that could occur when
reading ixfr.db.

19 May 2008: Matthijs
- Do not always log tcp read errors, only when real error or high verbosity

28 April 2008: Matthijs
- Bugfix #172
- Bugfix #172 (misleading error from zonec)

27 March 2008: Matthijs
- Port some branch modifications to trunk
Expand Down Expand Up @@ -33,7 +39,7 @@
7 January 2008: Wouter
- Fixup nsec3 tests, they need zonesdir: "." in conf files.
The tests pass.
- configure default is --enable-nsec3. Noted that this takes 20% more
- configure default is --enable-nsec3. Disabling this will save 20% more
memory (for very large zones). Moved tests to test on commit.
- set RRTYPE numbers for NSEC3=50, NSEC3PARAM=51.
- fixup checkconf test - updated parser lexer gives syntax error
Expand Down
3 changes: 3 additions & 0 deletions doc/RELNOTES
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ BUG FIXES:
- Changed man pages format from mdoc to mansun, to support the Solaris OS.
- Log tcp read error only when connection not reset by peer or when
verbosity level is high.
- RRs are compared without checking the TTL value.

FEATURES:
- NSD is now NSEC3 enabled by default. For NSEC, configure with
--disable-nsec3.
- Added "hide-version" configuration setting. Enabling this feature
stops NSD from answering to CHAOS class version requests.
- Added bind2nsd 0.5.0 (http://bind2nsd.sourceforge.net) in contrib/.
Expand Down
2 changes: 1 addition & 1 deletion mkinstalldirs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Created: 1993-05-16
# Public domain

# $Id: mkinstalldirs,v 1.1 2003/01/20 08:44:37 alexis Exp $
# $Id$

errstatus=0

Expand Down
3 changes: 2 additions & 1 deletion nsd-patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void
list_xfr(FILE *in)
{
uint32_t skiplen, len, new_serial;
int i;
/* int i; */
char zone_name[3072];
/* uint8_t hex_data; */
uint16_t id;
Expand All @@ -57,6 +57,7 @@ list_xfr(FILE *in)
zone_name, id, new_serial, seq_nr, skiplen);

/* Debug code, print the hexadecimal contents of the packet
needed for version 3.1.1
for (i=0; i<skiplen; i++) {
fread(&hex_data, 1, 1, in);
printf(" %2.2x ", hex_data);
Expand Down
6 changes: 4 additions & 2 deletions nsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ main (int argc, char *argv[])

/* Parse the command line... */
while ((c = getopt(argc, argv, "46a:c:df:hi:I:l:N:n:P:p:s:u:t:X:V:v"
#ifndef NDEBUG
#ifndef NDEBUG
"F:L:"
#endif /* NDEBUG */
)) != -1) {
Expand Down Expand Up @@ -555,7 +555,7 @@ main (int argc, char *argv[])
if(nsd.options->pidfile) nsd.pidfile = nsd.options->pidfile;
else nsd.pidfile = PIDFILE;
}
if(nsd.identity == hostname || nsd.identity == IDENTITY)
if(strcmp(nsd.identity, hostname)==0 || strcmp(nsd.identity,IDENTITY)==0)
{
if(nsd.options->identity) nsd.identity = nsd.options->identity;
}
Expand Down Expand Up @@ -595,6 +595,8 @@ main (int argc, char *argv[])
error("cannot chdir to '%s': %s",
nsd.options->zonesdir, strerror(errno));
}
DEBUG(DEBUG_IPC,1, (LOG_INFO, "changed directory to %s",
nsd.options->zonesdir));
}
/* get it from the config file */
#ifdef NSID
Expand Down
10 changes: 4 additions & 6 deletions server.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ server_init(struct nsd *nsd)
log_msg(LOG_ERR, "unable to chroot: %s", strerror(errno));
return -1;
}
else
log_msg(LOG_NOTICE, "changed root directory to %s", nsd->chrootdir);
DEBUG(DEBUG_IPC,1, (LOG_INFO, "changed root directory to %s",
nsd->chrootdir));

}
#endif
Expand Down Expand Up @@ -1398,8 +1398,7 @@ handle_tcp_reading(netio_type *netio,
if (verbosity >= 2 || errno != ECONNRESET) {
log_msg(LOG_ERR, "failed reading from tcp: %s", strerror(errno));
}
#endif
#ifndef ECONNRESET
#else /* ECONNRESET */
if (verbosity >= 2) {
log_msg(LOG_ERR, "failed reading from tcp: %s", strerror(errno));
}
Expand Down Expand Up @@ -1467,8 +1466,7 @@ handle_tcp_reading(netio_type *netio,
if (verbosity >= 2 || errno != ECONNRESET) {
log_msg(LOG_ERR, "failed reading from tcp: %s", strerror(errno));
}
#endif
#ifndef ECONNRESET
#else /* ECONNRESET */
if (verbosity >= 2) {
log_msg(LOG_ERR, "failed reading from tcp: %s", strerror(errno));
}
Expand Down
2 changes: 1 addition & 1 deletion tpkg/do-tests
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ done
tpkg report
#tpkg clean

do_long=no
do_long=yes
if [ $do_long = yes ]; then
LONGTESTS="testplan_axfr.tpkg testplan_ixfr_pkts.tpkg testplan_mess.tpkg testplan_axfr_tsig.tpkg testplan_ixfr_remove.tpkg testplan_timeout.tpkg testplan_deadlock.tpkg testplan_ixfr.tpkg testplan_tsig_34.tpkg bug_sighup.tpkg ixfr_rollback.tpkg reload_timeout.tpkg xfrd_connect_ip6.tpkg xfrd_tcp_overload.tpkg notify_interrupts_axfr.tpkg reload_timeout.tpkg bug137.tpkg bug145_multiple_zone_xfr.tpkg 213_large.tpkg"
cd long
Expand Down
Binary file added tpkg/long/0000_nsd-compile.tpkg
Binary file not shown.
Binary file modified tpkg/long/bug145_multiple_zone_xfr.tpkg
Binary file not shown.
Binary file modified tpkg/long/ixfr_rollback.tpkg
Binary file not shown.
Binary file modified tpkg/long/notify_interrupts_axfr.tpkg
Binary file not shown.
Binary file modified tpkg/long/testplan_ixfr.tpkg
Binary file not shown.
Binary file modified tpkg/xfr_1.tpkg
Binary file not shown.
Binary file modified tpkg/xfr_huge.tpkg
Binary file not shown.
8 changes: 4 additions & 4 deletions xfrd-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ int conn_write(xfrd_tcp_t* tcp)
}

assert(tcp->total_bytes < tcp->msglen + sizeof(tcp->msglen));

sent = write(tcp->fd,
buffer_current(tcp->packet),
buffer_remaining(tcp->packet));
Expand All @@ -323,20 +323,20 @@ int conn_write(xfrd_tcp_t* tcp)
return -1;
}
}

buffer_skip(tcp->packet, sent);
tcp->total_bytes += sent;

if(tcp->total_bytes < tcp->msglen + sizeof(tcp->msglen)) {
/* more to write when socket becomes writable again */
return 0;
}

assert(tcp->total_bytes == tcp->msglen + sizeof(tcp->msglen));
return 1;
}

void
void
xfrd_tcp_write(xfrd_tcp_set_t* set, xfrd_zone_t* zone)
{
int ret;
Expand Down
12 changes: 6 additions & 6 deletions zonec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,13 +1332,13 @@ zone_read(const char *name, const char *zonefile, nsd_options_t* nsd_options)
}

fclose(yyin);

fflush(stdout);
totalerrors += parser->errors;
parser->filename = NULL;
}

static void
static void
usage (void)
{
#ifndef NDEBUG
Expand All @@ -1347,7 +1347,7 @@ usage (void)
fprintf(stderr, "usage: zonec [-v|-h|-C] [-c configfile] [-o origin] [-d directory] [-f database] [-z zonefile]\n\n");
#endif
fprintf(stderr, "\tNSD zone compiler, creates database from zone files.\n");
fprintf(stderr, "\tVersion %s. Report bugs to <%s>.\n\n",
fprintf(stderr, "\tVersion %s. Report bugs to <%s>.\n\n",
PACKAGE_VERSION, PACKAGE_BUGREPORT);
fprintf(stderr, "\t-v\tBe more verbose.\n");
fprintf(stderr, "\t-h\tPrint this help information.\n");
Expand All @@ -1366,19 +1366,19 @@ usage (void)
extern char *optarg;
extern int optind;

int
int
main (int argc, char **argv)
{
struct namedb *db;
char *origin = NULL;
int c, errn;
int c;
region_type *global_region;
region_type *rr_region;
const char* configfile= CONFIGFILE;
const char* zonesdir = NULL;
const char* singlefile = NULL;
nsd_options_t* nsd_options = NULL;

log_init("zonec");

global_region = region_create(xalloc, free);
Expand Down

0 comments on commit 25c82bb

Please sign in to comment.