Yahoo Groups archive

Milter-greylist

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

Thread

Socket address structure length detection

Socket address structure length detection

2016-04-28 by Leonardo Arena

Hi all,

I'm porting milter-graylist to Alpine Linux (based on musl libc) and it
seems to me that sockaddr structure length is detected although isn't
present:


milter-greylist.c: In function 'real_connect':
milter-greylist.c:386:25: error: 'struct sockaddr_in' has no member
named 'sin_len'
    SA4(&priv->priv_addr)->sin_len = priv->priv_addrlen;


config.h has HAVE_SA_LEN defined:


(edge-x86_64) ~/aports/testing/milter-greylist/src/milter-greylist-4.4.3
$ grep HAVE_SA_LEN config.h
#define HAVE_SA_LEN /**/



If I comment it out, it compiles just fine.


I have very limited knowledge of autotools and C. Could anyone provide a
patch to properly detect socket address struct length support?

Or maybe I'm completely off-track?

Thank you

- leonardo

Re: [milter-greylist] Socket address structure length detection

2016-04-28 by Bob Friesenhahn

On Thu, 28 Apr 2016, Leonardo Arena rnalrd@... [milter-greylist] wrote:

> (edge-x86_64) ~/aports/testing/milter-greylist/src/milter-greylist-4.4.3
> $ grep HAVE_SA_LEN config.h
> #define HAVE_SA_LEN /**/
>
>
>
> If I comment it out, it compiles just fine.
>
>
> I have very limited knowledge of autotools and C. Could anyone provide a
> patch to properly detect socket address struct length support?
>
> Or maybe I'm completely off-track?

I would guess that configure is correct but that milter-greylist code 
is not correctly including the header files that configure used while 
it was doing its testing (i.e. missing header inclusion).  Grep across 
all the system header files to make sure that SA_LEN really does not 
exist.  If it does exist, another possibility is that some define (or 
lack thereof) is necessary for it to be exposed.

Bob
-- 
Bob Friesenhahn
bfriesen@..., http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

Re: [milter-greylist] Socket address structure length detection

2016-04-28 by Hajimu UMEMOTO

Hi,

>>>>> On Thu, 28 Apr 2016 15:59:21 +0200
>>>>> "Leonardo Arena rnalrd@... [milter-greylist]" <milter-greylist@yahoogroups.com> said:

milter-greylist> I'm porting milter-graylist to Alpine Linux (based on musl libc) and it
milter-greylist> seems to me that sockaddr structure length is detected although isn't
milter-greylist> present:

milter-greylist> milter-greylist.c: In function 'real_connect':
milter-greylist> milter-greylist.c:386:25: error: 'struct sockaddr_in' has no member
milter-greylist> named 'sin_len'
milter-greylist>     SA4(&priv->priv_addr)->sin_len = priv->priv_addrlen;

milter-greylist> config.h has HAVE_SA_LEN defined:

milter-greylist> (edge-x86_64) ~/aports/testing/milter-greylist/src/milter-greylist-4.4.3
milter-greylist> $ grep HAVE_SA_LEN config.h
milter-greylist> #define HAVE_SA_LEN /**/

It seems strange to me.  Basically, having sa_len in struct sockaddr
is BSD flavor, and Linux doesn't have it.
I'm not sure why configure (AC_CHECK_MEMBER) detects sa_len in struct
sockaddr on your box.
Did you make sure to run configure?

milter-greylist> If I comment it out, it compiles just fine.

It seems to me that your struct sockaddr doesn't have sa_len.

Sincerely,

--
Hajimu UMEMOTO
ume@...  ume@...
http://www.mahoroba.org/~ume/

Re: [milter-greylist] Socket address structure length detection

2016-04-28 by manu@...

Leonardo Arena rnalrd@... [milter-greylist]
<milter-greylist@yahoogroups.com> wrote:

> milter-greylist.c: In function 'real_connect':
> milter-greylist.c:386:25: error: 'struct sockaddr_in' has no member
> named 'sin_len'
>     SA4(&priv->priv_addr)->sin_len = priv->priv_addrlen;
> 
> 
> config.h has HAVE_SA_LEN defined:

Perhaps the autoconf test is somehow broken or misused? What does the
log says? Please peek at config.log, and search for "checking for struct
sockaddr.sa_len" 


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

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.