Commit 4756259a authored by Per Cederqvist's avatar Per Cederqvist
Browse files

This commit includes three broken things; see FIXMEs in the code.

Include <sys/socket.h> and <netinet/in.h>.
(SOCKADDR_STORAGE): Define it to struct sockaddr_storage or struct
	sockaddr, depending on HAVE_STRUCT_SOCKADDR_STORAGE.
(union sockaddrs): New union.
(IscAddress): Use union sockaddrs instead of struct sockaddr.
parent 48f33194
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#ifndef __ISC_H__ #ifndef __ISC_H__
#define __ISC_H__ #define __ISC_H__
/* FIXME (Bug 563): Don't include files here. */
#include <sys/socket.h>
#include <netinet/in.h>
/* /*
** Give the poor user a chance to change it ** Give the poor user a chance to change it
...@@ -71,6 +74,20 @@ ...@@ -71,6 +74,20 @@
#define ISC_DEFAULT_MAX_BACKLOG 5 #define ISC_DEFAULT_MAX_BACKLOG 5
/*
* For IPv4/IPv6 compatibility:
* SOCKADDR_STORAGE: Socket address storage type.
* struct sockaddr_storage is used when available (RFC2553)
*/
/* FIXME (Bug 563): HAVE_STRUCT_SOCKADDR_STORAGE is only defined when
compiling the isc library. Move this to intern.h, if possible. */
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
#define SOCKADDR_STORAGE struct sockaddr_storage
#else
#define SOCKADDR_STORAGE struct sockaddr
#endif
/* /*
** Configuration structure for sessions ** Configuration structure for sessions
...@@ -166,6 +183,19 @@ typedef enum ...@@ -166,6 +183,19 @@ typedef enum
} IscSessionState; } IscSessionState;
/* Socket address
*/
union sockaddrs {
SOCKADDR_STORAGE ssa;
struct sockaddr sa;
struct sockaddr_in sa_in;
/* FIXME (Bug 563): USE_INET6 is only defined when compiling the
isc library. Move this to intern.h, if possible. */
#ifdef USE_INET6
struct sockaddr_in6 sa_in6;
#endif
};
/* /*
** Message information structure ** Message information structure
...@@ -174,7 +204,7 @@ IscAddress ...@@ -174,7 +204,7 @@ IscAddress
{ {
struct struct
{ {
struct sockaddr saddr; union sockaddrs saddr;
} ip; } ip;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment