Yahoo Groups archive

Milter-greylist

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

Message

Re: [milter-greylist] MX sync bind failed - Address in use

2004-06-17 by manu@netbsd.org

Cyril Guibourg <cg+milter-greylist@...> wrote:

> I believe the bug is in sync.c where the service number returned by
> getservbyname() is assigned using htons() which reverts the byte order.

Yes, you are right. From the man page:
s_port     The port number at which the service resides.  Port numbers
           must be given and are returned in network byte order.

I did not noticed that bug since both my MX are big endian machines.

Here is a patch that should fix it:

Index: sync.c
===================================================================
RCS file: /cvsroot/milter-greylist/sync.c,v
retrieving revision 1.45
diff -r1.45 sync.c
299c299
<               service = MXGLSYNC_PORT;
---
>               service = htons(MXGLSYNC_PORT);
324c324
<       raddr.sin_port = htons(service);
---
>       raddr.sin_port = service;
442c442
<               service = MXGLSYNC_PORT;
---
>               service = htons(MXGLSYNC_PORT);
465c465
<       laddr.sin_port = htons(service);
---
>       laddr.sin_port = service;

-- 
Emmanuel Dreyfus
Il y a 10 sortes de personnes dans le monde: ceux qui comprennent 
le binaire et ceux qui ne le comprennent pas.
manu@...

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.