diff options
| author | itojun <itojun@NetBSD.org> | 2001-11-20 03:50:49 +0000 |
|---|---|---|
| committer | itojun <itojun@NetBSD.org> | 2001-11-20 03:50:49 +0000 |
| commit | 273a0d13f31e9146e9665fc2e8f72c3c3a519a47 (patch) | |
| tree | a7208d11680ee2442ce20c534c36693054fb4198 /gnu | |
| parent | 8f0070db309993a2a6bd66c3043d26f742db6d94 (diff) | |
cleanup leftover of IPv6 patch
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/dist/postfix/IPv6_README | 22 | ||||
| -rw-r--r-- | gnu/dist/postfix/src/global/wildcard_inet_addr.c | 80 | ||||
| -rw-r--r-- | gnu/dist/postfix/src/global/wildcard_inet_addr.h | 36 | ||||
| -rw-r--r-- | gnu/dist/postfix/src/util/get_port.c | 65 | ||||
| -rw-r--r-- | gnu/dist/postfix/src/util/get_port.h | 28 |
5 files changed, 0 insertions, 231 deletions
diff --git a/gnu/dist/postfix/IPv6_README b/gnu/dist/postfix/IPv6_README deleted file mode 100644 index 344bd93f2f9..00000000000 --- a/gnu/dist/postfix/IPv6_README +++ /dev/null @@ -1,22 +0,0 @@ -IPv6-ready postfix -KAME project -$KAME: IPv6_README,v 1.2 2001/04/03 01:04:31 itojun Exp $ - - -IPv4 mapped address is not supported. - -TODO: -- make it possible to run the following configuration on IPv4-only, and - IPv4/v6 dual stack node. - inet_interfaces = localhost - at this moment, during initialization, localhost will be expanded into - INET_ADDR_LIST, then we go through them in socket/bind/listen loop. - therefore, if we fail to socket(2) it will be considered a fatal error. - instead, we need to manage addresses by string (as is), and then - go through it by using getaddrinfo. socket(2) should not be considered - a fatal error. - - at this moment, we simply filter out address that is not supported by the - kernel. this leads to wrong behavior in some cases. -- use sockaddr everywhere, not just 4/16byte address (util/inet_addr_host.c). -- update source address selection on virtual host configuration, outbound. diff --git a/gnu/dist/postfix/src/global/wildcard_inet_addr.c b/gnu/dist/postfix/src/global/wildcard_inet_addr.c deleted file mode 100644 index eaae70bef91..00000000000 --- a/gnu/dist/postfix/src/global/wildcard_inet_addr.c +++ /dev/null @@ -1,80 +0,0 @@ -/* System library. */ - -#include <sys_defs.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <string.h> -#ifdef INET6 -#include <sys/socket.h> -#endif -#include <netdb.h> - -#ifdef STRCASECMP_IN_STRINGS_H -#include <strings.h> -#endif - -/* Utility library. */ - -#include <msg.h> -#include <mymalloc.h> -#include <inet_addr_list.h> -#include <inet_addr_local.h> -#include <inet_addr_host.h> -#include <stringops.h> - -/* Global library. */ - -#include <mail_params.h> -#include <wildcard_inet_addr.h> - -/* Application-specific. */ -static INET_ADDR_LIST addr_list; - -/* wildcard_inet_addr_init - initialize my own address list */ - -static void wildcard_inet_addr_init(INET_ADDR_LIST *addr_list) -{ -#ifdef INET6 - struct addrinfo hints, *res, *res0; - char hbuf[NI_MAXHOST]; - int error; -#ifdef NI_WITHSCOPEID - const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID; -#else - const int niflags = NI_NUMERICHOST; -#endif - - inet_addr_list_init(addr_list); - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_flags = AI_PASSIVE; - error = getaddrinfo(NULL, "0", &hints, &res0); - if (error) - msg_fatal("could not get list of wildcard addresses"); - for (res = res0; res; res = res->ai_next) { - if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), - NULL, 0, niflags) != 0) - continue; - if (inet_addr_host(addr_list, hbuf) == 0) - msg_fatal("config variable %s: host not found: %s", - VAR_INET_INTERFACES, hbuf); - } - freeaddrinfo(res0); -#else - if (inet_addr_host(addr_list, "0.0.0.0") == 0) - msg_fatal("config variable %s: host not found: %s", - VAR_INET_INTERFACES, "0.0.0.0"); -#endif -} - -/* wildcard_inet_addr_list - return list of addresses */ - -struct INET_ADDR_LIST *wildcard_inet_addr_list(void) -{ - if (addr_list.used == 0) - wildcard_inet_addr_init(&addr_list); - - return (&addr_list); -} diff --git a/gnu/dist/postfix/src/global/wildcard_inet_addr.h b/gnu/dist/postfix/src/global/wildcard_inet_addr.h deleted file mode 100644 index eb1a3bd3a0f..00000000000 --- a/gnu/dist/postfix/src/global/wildcard_inet_addr.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _WILDCARD_INET_ADDR_H_INCLUDED_ -#define _WILDCARD_INET_ADDR_H_INCLUDED_ - -/*++ -/* NAME -/* wildcard_inet_addr_list 3h -/* SUMMARY -/* grab the list of wildcard IP addresses. -/* SYNOPSIS -/* #include <own_inet_addr.h> -/* DESCRIPTION -/* .nf -/*--*/ - - /* - * System library. - */ -#include <netinet/in.h> -#ifdef INET6 -#include <sys/socket.h> -#endif - - /* - * External interface. - */ -extern struct INET_ADDR_LIST *wildcard_inet_addr_list(void); - -/* LICENSE -/* .ad -/* .fi -/* foo -/* AUTHOR(S) -/* Jun-ichiro itojun Hagino -/*--*/ - -#endif diff --git a/gnu/dist/postfix/src/util/get_port.c b/gnu/dist/postfix/src/util/get_port.c deleted file mode 100644 index de0aaf44e9d..00000000000 --- a/gnu/dist/postfix/src/util/get_port.c +++ /dev/null @@ -1,65 +0,0 @@ -/*++ -/* NAME -/* get_port 3 -/* SUMMARY -/* trivial host and port extracter -/* SYNOPSIS -/* #include <get_port.h> -/* -/* char *get_port(data) -/* char *data; -/* -/* DESCRIPTION -/* get_port() extract host name or ip address from -/* strings such as [3ffe:902:12::10]:25, [::1] -/* or 192.168.0.1:25, and null-terminates the -/* \fIdata\fR at the first occurrence of port separator. -/* DIAGNOSTICS -/* If port not found return null pointer. -/* LICENSE -/* .ad -/* .fi -/* BSD Style (or BSD like) license. -/* AUTHOR(S) -/* Arkadiusz Mi¶kiewicz <misiek@pld.org.pl> -/* Wroclaw, POLAND -/*--*/ - -/* System libraries */ - -#include <sys_defs.h> -#include <string.h> - -/* Utility library. */ - -#include "get_port.h" - -/* get_port - extract port number from string */ - -char *get_port(char *data) -{ - const char *escl=strchr(data,'['); - const char *sepl=strchr(data,':'); - char *escr=strrchr(data,']'); - char *sepr=strrchr(data,':'); - - /* extract from "[address]:port" or "[address]"*/ - if (escl && escr) - { - memmove(data, data + 1, strlen(data) - strlen(escr)); - data[strlen(data) - strlen(escr) - 1] = 0; - *escr++ = 0; - if (*escr == ':') - escr++; - return (*escr ? escr : NULL); - } - /* extract from "address:port" or "address" */ - if ((sepl == sepr) && sepr && sepl) - { - *sepr++ = 0; - return sepr; - } - - /* return empty string */ - return NULL; -} diff --git a/gnu/dist/postfix/src/util/get_port.h b/gnu/dist/postfix/src/util/get_port.h deleted file mode 100644 index b0fb437780c..00000000000 --- a/gnu/dist/postfix/src/util/get_port.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _GET_PORT_H_INCLUDED_ -#define _GET_PORT_H_INCLUDED_ - -/*++ -/* NAME -/* get_port 3h -/* SUMMARY -/* trivial host and port extracter -/* SYNOPSIS -/* #include <get_port.h> -/* DESCRIPTION -/* .nf - - /* External interface. */ - -extern char *get_port(char *); - - -/* LICENSE -/* .ad -/* .fi -/* BSD Style (or BSD like) license. -/* AUTHOR(S) -/* Arkadiusz Mi¶kiewicz <misiek@pld.org.pl> -/* Wroclaw, POLAND -/*--*/ - -#endif |
