You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1995/11/18 18:33:50 UTC

Re: .16 patches

> >      44_ident.0.8.16.patch           [empty !]
> I've uploaded it again. Here is the header:
> 
>  From: drtr@ast.cam.ac.uk (David Robinson)
>  Subject: Fix IdentityCheck with Virtual Hosts
>  Affects: http_main.c, util.c
>  ChangeLog: Ensure that rfc931() is given a sockaddr describing the local
>            address (virtual host) that is currently in use.
>  Comments: Before this patch, rfc931() was passed 0.0.0.0 as the local address;
>            on some systems bind() managed to correctly choose the IP address
>            for the virtual host currently in use!
> 
>  David.

This patch has created a warning on NetBSD regarding the declaration of
'struct sockaddr sa_server' in child_main and it's use as an argument
for getsockname().  Looking through this file, we specifically cast
many(most) of the socket addresses for the connections to sockaddr_in.

The structure size is significantly bigger for sockaddr_in which
if I understand correctly, would increase the memory usage per
connection.  Do we need to be making these casts?


Structure comparisions follow:

SunOS:

struct sockaddr {
        u_short sa_family;              /* address family */
        char    sa_data[14];            /* up to 14 bytes of direct address */
};

struct sockaddr_in {
        short   sin_family;
        u_short sin_port;
        struct  in_addr sin_addr;
        char    sin_zero[8];
};


NetBSD:

struct sockaddr {
    u_char  sa_len;         /* total length */
    u_char  sa_family;      /* address family */
    char    sa_data[14];        /* actually longer; address value */
};    
 

struct sockaddr_in {
    u_int8_t  sin_len;
    u_int8_t  sin_family;
    u_int16_t sin_port;
    struct    in_addr sin_addr;
    int8_t    sin_zero[8];
};