httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: .16 patches
Date Sat, 18 Nov 1995 17:29:07 GMT
> 
> > >      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?

Actually, they're all the same size.

> 
> 
> 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];
> };  
> 
> 

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant        Fax:   +44 (181) 994 6472
and Technical Director      Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.

Mime
View raw message