Yahoo Groups archive

Milter-greylist

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

Message

sync.c:local_addr() use

2005-03-26 by Ranko Zivojnovic

Greetings,

Apparently there is a slight problem in the way the local_addr()
function in sync.c is being used.

I have set up v1.6 in a test mode on a couple of Solaris boxes to
evaluate the possibility of using milter-greylist for our production
machines.

After running the milter for a while, I started getting the following
errors in my mail log:
peer x.x.x.x queue overflow (1024 entries), discarding new entry

After looking for a while through the source code and attaching the
process in the debugger, I've found that my peer that I've specified in
the config, is flagged with the P_LOCAL flag.

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

Clearly, having failed to bind to the given IP address should indicate
that the address is NOT a local address, the function should have
returned 0 rather than -1. But since it did return -1, my peer got
flagged as P_LOCAL and has never got an update.

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.

The same issue also exists in 2.0b3 code.

Best regards,

Ranko

-- 
Ranko Zivojnovic,
IT Director/CTO          ranko@...

Spidernet Services Ltd., Tel: +357 22 844844
Nicosia, Cyprus          FAX: +357 22 669470

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.