[sane-devel] backends 1.0.12 compile-error

Gerfried Maier moali@sbox.tugraz.at
Tue, 03 Jun 2003 13:44:41 +0200


Erik Inge Bolsų wrote:

>On Tue, 3 Jun 2003, Gerfried Maier wrote:
>  
>
>>[...]
>>
>>remote_address is defined somewhere around line 195 in saned.c:
>>[...]
>>#ifdef SANED_USES_AF_INDEP
>>static struct sockaddr_storage remote_address;
>>static int remote_address_len;
>>#else
>>static struct in_addr remote_address;
>>#endif /* SANED_USES_AF_INDEP */
>>[...]
>>    
>>
>
>Can you check in your config.h post-configure if "SANED_USES_AF_INDEP" is
>defined or undefined?
>
>If it is undefined, the error would seem to be straightforward, since at
>least my struct in_addr (in netinet/in.h ) doesn't have any ss_family
>member...
>
>/* Internet address.  */
>typedef uint32_t in_addr_t;
>struct in_addr
>  {
>    in_addr_t s_addr;
>  };
>
I just figured out that sockaddr_storage is defined in bits/socket.h. 
There it says (around line 143):

[...]
/* Structure large enough to hold any socket address (with the historical
   exception of AF_UNIX).  We reserve 128 bytes.  */
#if ULONG_MAX > 0xffffffff
# define __ss_aligntype __uint64_t
#else
# define __ss_aligntype __uint32_t
#endif
#define _SS_SIZE        128
#define _SS_PADSIZE     (_SS_SIZE - (2 * sizeof (__ss_aligntype)))

struct sockaddr_storage
  {
    __SOCKADDR_COMMON (__ss_);  /* Address family, etc.  */
    __ss_aligntype __ss_align;  /* Force desired alignment.  */
    char __ss_padding[_SS_PADSIZE];
  };
[...]

No (obvious?) member ss_family, too.


Maier Gerfried