Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8fc86dd

Browse files
committed
We have just finished porting the old KAME IPv6 patch over to
postgresql version 7.3, but yea... this patch adds full IPv6support to postgres. I've tested it out on 7.2.3 and hasbeen running perfectly stable.CREDITS: The KAME Project (Initial patch) Nigel Kukard <nkukard@lbsd.net> Johan Jordaan <johanj@lando.co.za>
1 parent87cba40 commit8fc86dd

File tree

12 files changed

+328
-275
lines changed

12 files changed

+328
-275
lines changed

‎configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15778,7 +15778,7 @@ fi
1577815778
ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
1577915779
1578015780
15781-
ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
15781+
ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template} src/interfaces/libpq/v6util.c:src/backend/libpq/v6util.c"
1578215782
1578315783
1578415784
ac_config_headers="$ac_config_headers src/include/pg_config.h"
@@ -16266,6 +16266,7 @@ do
1626616266
"src/include/dynloader.h" ) CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;;
1626716267
"src/include/pg_config_os.h" ) CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
1626816268
"src/Makefile.port" ) CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
16269+
"src/interfaces/libpq/v6util.c" ) CONFIG_LINKS="$CONFIG_LINKS src/interfaces/libpq/v6util.c:src/backend/libpq/v6util.c" ;;
1626916270
"src/include/pg_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
1627016271
*) { { echo "$as_me:$LINENO: error: invalid argument:$ac_config_target" >&5
1627116272
echo "$as_me: error: invalid argument:$ac_config_target" >&2;}

‎configure.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.219 2002/12/03 21:50:43 momjian Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.220 2002/12/06 03:46:24 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1182,6 +1182,7 @@ AC_CONFIG_LINKS([
11821182
src/include/dynloader.h:src/backend/port/dynloader/${template}.h
11831183
src/include/pg_config_os.h:src/include/port/${template}.h
11841184
src/Makefile.port:src/makefiles/Makefile.${template}
1185+
src/interfaces/libpq/v6util.c:src/backend/libpq/v6util.c
11851186
])
11861187

11871188
AC_CONFIG_HEADERS([src/include/pg_config.h],

‎src/backend/libpq/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for libpq subsystem (backend half of libpq interface)
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.33 2002/06/14 04:23:17 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.34 2002/12/06 03:46:24 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global
1515
# be-fsstubs is here for historical reasons, probably belongs elsewhere
1616

1717
OBJS = be-fsstubs.o be-secure.o auth.o crypt.o hba.o md5.o pqcomm.o\
18-
pqformat.o pqsignal.o
18+
pqformat.o pqsignal.o v6util.o
1919

2020

2121
all: SUBSYS.o

‎src/backend/libpq/auth.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.92 2002/12/03 22:09:19 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.93 2002/12/06 03:46:24 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -410,9 +410,12 @@ ClientAuthentication(Port *port)
410410
*/
411411
{
412412
constchar*hostinfo="localhost";
413+
charip_hostinfo[INET6_ADDRSTRLEN];
414+
if (isAF_INETx(&port->raddr.sa) ){
415+
hostinfo=SockAddr_ntop(&port->raddr,ip_hostinfo,
416+
INET6_ADDRSTRLEN,1);
417+
}
413418

414-
if (port->raddr.sa.sa_family==AF_INET)
415-
hostinfo=inet_ntoa(port->raddr.in.sin_addr);
416419
elog(FATAL,
417420
"No pg_hba.conf entry for host %s, user %s, database %s",
418421
hostinfo,port->user,port->database);

‎src/backend/libpq/hba.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.88 2002/12/03 21:50:44 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.89 2002/12/06 03:46:26 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -582,9 +582,8 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
582582
}
583583
elseif (strcmp(token,"host")==0||strcmp(token,"hostssl")==0)
584584
{
585-
structin_addrfile_ip_addr,
586-
mask;
587-
585+
SockAddrfile_ip_addr,mask;
586+
588587
if (strcmp(token,"hostssl")==0)
589588
{
590589
#ifdefUSE_SSL
@@ -619,16 +618,25 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
619618
if (!line)
620619
gotohba_syntax;
621620
token=lfirst(line);
622-
if (!inet_aton(token,&file_ip_addr))
623-
gotohba_syntax;
621+
622+
if(SockAddr_pton(&file_ip_addr,token,strlen(token))<0){
623+
gotohba_syntax;
624+
}
624625

625626
/* Read the mask field. */
626627
line=lnext(line);
627628
if (!line)
628629
gotohba_syntax;
629630
token=lfirst(line);
630-
if (!inet_aton(token,&mask))
631-
gotohba_syntax;
631+
632+
if(SockAddr_pton(&mask,token,strlen(token))<0){
633+
gotohba_syntax;
634+
}
635+
636+
637+
if(file_ip_addr.sa.sa_family!=mask.sa.sa_family){
638+
gotohba_syntax;
639+
}
632640

633641
/* Read the rest of the line. */
634642
line=lnext(line);
@@ -639,8 +647,7 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
639647
gotohba_syntax;
640648

641649
/* Must meet network restrictions */
642-
if (port->raddr.sa.sa_family!=AF_INET||
643-
((file_ip_addr.s_addr ^port->raddr.in.sin_addr.s_addr)&mask.s_addr)!=0)
650+
if (!isAF_INETx(&port->raddr)|| !rangeSockAddr(&port->raddr,&file_ip_addr,&mask))
644651
return;
645652
}
646653
else

‎src/backend/libpq/pg_hba.conf.sample

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@
4444

4545
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
4646

47-
local all all trust
48-
host all all 127.0.0.1 255.255.255.255 trust
47+
local all all trust
48+
host all all 127.0.0.1 255.255.255.255 trust
49+
host all all ::1 ffff:ffff:ffff:fff:ffff:ffff:ffff trust

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp