Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] sync.c:local_addr() use

2005-03-26 by manu@netbsd.org

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.org

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.