Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 1996 09:30:58 PST
From:      "Marty Leisner" <leisner@sdsp.mc.xerox.com>
To:        hackers@freebsd.org
Cc:        samba-bugs@anu.edu.au
Subject:   sin_len in sockaddr_in?
Message-ID:  <9601181730.AA12865@gnu.mc.xerox.com>

next in thread | raw e-mail | index | archive | help

I'm working with samba 1.9.15p8 (on Sunos...)

I want to close the accepting connections after the fork...

I noticed:
(in util.c)

   3688
   3689   bzero((char *)&sock,sizeof(sock));
   3690   memcpy((char *)&sock.sin_addr,(char *)hp->h_addr, hp->h_length);
   3691 #if defined(__FreeBSD__) || defined(NETBSD) /* XXX not the right ifdef *
   3692   sock.sin_len = sizeof(sock);
   3693 #endif
   3694   sock.sin_port = htons( port );
   3695   sock.sin_family = hp->h_addrtype;
   3696   sock.sin_addr.s_addr = INADDR_ANY;
   3697 

sock is sockaddr_in...

On sunos Its defined as:
struct sockaddr_in {
        short   sin_family;
        u_short sin_port;
        struct  in_addr sin_addr;
        char    sin_zero[8];
};

what's going on?  we pass the length in the call anyway..

On freebsd it looks like:
struct sockaddr_in {
        u_char  sin_len;
        u_char  sin_family;
        u_short sin_port;
        struct  in_addr sin_addr;
        char    sin_zero[8];
};



marty		leisner@sdsp.mc.xerox.com   
Member of the League for Programming Freedom (http://www.lpf.org)
Any sufficiently advanced technology is indistinguishable from magic
        Arthur C. Clarke, The Lost Worlds of 2001



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9601181730.AA12865>