Ranko Zivojnovic <ranko@...> wrote:
> Looking further through the code, I saw that local_addr() function can
> return three values: 1, 0 and -1, but it is used in the code as "true" -
> "false" kind of call:
> if(local_addr(...)) {
> ...
> }
>
> Then I went back couple of days in my logs and found the following
> error:
> local_addr: bind failed: Bad file number
(snip)
> I did fix it localy to return 0 rather than -1, however I thought I
> should let you know of the issue and you might want to reconsider the
> use of local_addr() in a different way.
I think your fix just ignore if the address is local or not, and force
it to be non local.
Here socket() returned a positive file descriptor, but it's still a bad
file descriptor. Bad file number is EBADF, right? Anyone used to Solaris
can comment on this?
--
Emmanuel Dreyfus
Un bouquin en français sur BSD:
http://www.eyrolles.com/Informatique/Livre/9782212114638/livre-bsd.php
manu@netbsd.orgMessage
Re: [milter-greylist] sync.c:local_addr() use
2005-03-26 by manu@netbsd.org
Attachments
- No local attachments were found for this message.