[sane-devel] backends 1.0.12 compile-error

Erik Inge Bolsų knan@mo.himolde.no
Tue, 3 Jun 2003 12:09:55 +0200 (CEST)


On Tue, 3 Jun 2003, Gerfried Maier wrote:
>Martijn van Oosterhout wrote:
>>On Tue, Jun 03, 2003 at 09:42:19AM +0200, Gerfried Maier wrote:
>>>saned.c: In function `check_host':
>>>saned.c:559: structure has no member named `ss_family'
>>>saned.c:562: warning: unreachable code at beginning of switch statement
>
>The affected lines from saned.c - unfortunately I'm not very used to
>C-programming, so that I cannot read that much out of them:
>
>
>[...]
>  switch (remote_address.ss_family)
>    {
>      case AF_INET:
>        if (IN_LOOPBACK (ntohl (sin->sin_addr.s_addr)))
>          {
>            DBG (DBG_MSG,
>                 "check_host: remote host is IN_LOOPBACK: access
>granted\n");
>            return SANE_STATUS_GOOD;
>          }
>        break;
>[...]
>
>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;
  };

--
Erik I. Bolsų | email: <knan at mo.himolde.no>
The UNIX philosophy basically involves giving you enough rope to
hang yourself.  And then a couple of feet more, just to be sure.