Re: sockaddr_in structure in in.h

Richard B. Johnson (root@analogic.com)
Sat, 22 Feb 1997 17:28:51 -0500 (EST)


On Sat, 22 Feb 1997, =?ISO-8859-1?Q?Tom=E1s_Restrepo?= wrote:

> I have been looking at /usr/include/linux/in.h
> Can someone tell me why the structure sockaddr_in is defined different
> in kernel versions 2.1.26 and 2.0.29?
> In 2.0.29 it is defined :
>
> struct sockaddr_in {
> short int sin_family; /* Address family */
> unsigned short int sin_port; /* Port number */
> struct in_addr sin_addr; /* Internet address */
>
> /* Pad to size of `struct sockaddr'. */
> unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
> sizeof(unsigned short int) - sizeof(struct
> in_addr)];
> };
>
> and in 2.1.26 :
>
> struct sockaddr_in
> {
> sa_family_t sin_family; /* Address family */
> unsigned short int sin_port; /* Port number */
> struct in_addr sin_addr; /* Internet address */
>
> /* Pad to size of `struct sockaddr'. */
> unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
> sizeof(unsign\ed short int) - sizeof(struct in_addr)];
> };

Just find the header file that defines sa_family_t and include it in the
source. This is a common problem with updating older ports. To make stuff
compile on many platforms, there are a lot of new "types" of objects being
defined. I remember way back where there was almost a WAR over the
introduction of "size_t". Get used to it!

Cheers,
Dick Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp : ftp@boneserver.analogic.com
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.26 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-