Inserted some extra code to test

This commit is contained in:
Michiel Broek 2007-09-16 12:43:26 +00:00
parent 5591a429eb
commit d5cfcb9397
2 changed files with 10 additions and 3 deletions

View File

@ -16,6 +16,7 @@ v0.91.11 02-Sep-2007
mbtask: mbtask:
Added some debug logging to investigate a problem with Added some debug logging to investigate a problem with
outbound scanning. outbound scanning.
Inserted some extra code to test..
v0.91.10 21-Aug-2007 - 02-Sep-2007 v0.91.10 21-Aug-2007 - 02-Sep-2007

View File

@ -59,6 +59,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
struct dirent *de; struct dirent *de;
int rc = 0, isflo, fage; int rc = 0, isflo, fage;
time_t t_start; time_t t_start;
unsigned short t_net, t_node, t_point;
t_start = time(NULL); t_start = time(NULL);
fname = calloc(PATH_MAX, sizeof(char)); fname = calloc(PATH_MAX, sizeof(char));
@ -85,7 +86,9 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
strncat(fname,de->d_name,PATH_MAX-strlen(fname)-2); strncat(fname,de->d_name,PATH_MAX-strlen(fname)-2);
if ((strcasecmp(de->d_name+9,"pnt") == 0) && !ispoint) { if ((strcasecmp(de->d_name+9,"pnt") == 0) && !ispoint) {
sscanf(de->d_name,"%04x%04x",&addr.net,&addr.node); sscanf(de->d_name,"%04hx%04hx",&t_net,&t_node);
addr.net = t_net;
addr.node = t_node;
Syslog('m', "sscanf 1 \"%s\" \"%s\" => %d %d", dname, de->d_name, addr.net, addr.node); Syslog('m', "sscanf 1 \"%s\" \"%s\" => %d %d", dname, de->d_name, addr.net, addr.node);
if ((rc = scan_dir(fn, fname, 1))) if ((rc = scan_dir(fn, fname, 1)))
goto exout; goto exout;
@ -106,10 +109,13 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
(strcasecmp(de->d_name+8,".req") == 0) || (strcasecmp(de->d_name+8,".req") == 0) ||
(strcasecmp(de->d_name+8,".pol") == 0)) { (strcasecmp(de->d_name+8,".pol") == 0)) {
if (ispoint) { if (ispoint) {
sscanf(de->d_name,"%08x", &addr.point); sscanf(de->d_name,"%08hx", &t_point);
addr.point = t_point;
Syslog('m', "sscanf 3 \"%s\" \"%s\" => %d %d %d", dname, de->d_name, addr.net, addr.node, addr.point); Syslog('m', "sscanf 3 \"%s\" \"%s\" => %d %d %d", dname, de->d_name, addr.net, addr.node, addr.point);
} else { } else {
sscanf(de->d_name,"%04x%04x", &addr.net,&addr.node); sscanf(de->d_name,"%04hx%04hx", &t_net,&t_node);
addr.net = t_net;
addr.node = t_node;
Syslog('m', "sscanf 2 \"%s\" \"%s\" => %d %d", dname, de->d_name, addr.net, addr.node); Syslog('m', "sscanf 2 \"%s\" \"%s\" => %d %d", dname, de->d_name, addr.net, addr.node);
} }
flavor = tolower(de->d_name[9]); flavor = tolower(de->d_name[9]);