9fans archive / 1998 / 09 / 8 / prev next
From: arisawa@ar.... arisawa@ar....
Subject: [9fans] 9tftpd
Date: Wed, 2 Sep 1998 07:25:29 -0400 (EDT)
Hello 9fans.
I received bug report of 9tftpd from beleos@pla....
Thanks,
Kenji Arisawa
E-mail: arisawa@aic...
---------------------- bug report ------------------
It is working fine except for one problem - after a number of
bootp's
(about 10 or so) 9tftpd eventually fails with a
"tftpopen: error (0): no free file descriptors" message.
The file descriptor leak appears to be in the ip2bootf function.
Adding 2 ndbclose() statements appears to fix the problem.
old:
db = ndbopen(0);
if(db == 0) return 0;
if(ipinfo(db, 0, ip, 0, &info) < 0)
return 0;
if(info.bootf[0])
return info.bootf;
return 0;
new:
db = ndbopen(0);
if(db == 0) return 0;
if(ipinfo(db, 0, ip, 0, &info) < 0) {
ndbclose(db);
return 0;
}
if(info.bootf[0]) {
ndbclose(db);
return info.bootf;
}
return 0;