summaryrefslogtreecommitdiff
path: root/libexec/ftp-proxy/util.c
diff options
context:
space:
mode:
authorMike Frantzen <frantzen@cvs.openbsd.org>2001-09-15 03:54:41 +0000
committerMike Frantzen <frantzen@cvs.openbsd.org>2001-09-15 03:54:41 +0000
commitadeb7017dd09e40a6a27a4a9c5242c35377a7009 (patch)
tree4363966006567e7a4d76a052d57a7c3c54d56678 /libexec/ftp-proxy/util.c
parent30f56e676fcfe49de9e3435f2ddfdf2723c5c03d (diff)
IPv6 support from Ryan McBride (mcbride@countersiege.com)
Diffstat (limited to 'libexec/ftp-proxy/util.c')
-rw-r--r--libexec/ftp-proxy/util.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libexec/ftp-proxy/util.c b/libexec/ftp-proxy/util.c
index 8c55b1d9c6d..a0b2755bf2d 100644
--- a/libexec/ftp-proxy/util.c
+++ b/libexec/ftp-proxy/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.5 2001/09/05 20:40:10 beck Exp $ */
+/* $OpenBSD: util.c,v 1.6 2001/09/15 03:54:40 frantzen Exp $ */
/*
* Copyright (c) 1996-2001
@@ -95,10 +95,12 @@ get_proxy_env(int connected_fd, struct sockaddr_in *real_server_sa_ptr,
/*
* Build up the pf natlook structure.
+ * Just for IPv4 right now
*/
memset((void *)&natlook, 0, sizeof(natlook));
- natlook.saddr = client_sa_ptr->sin_addr.s_addr;
- natlook.daddr = real_server_sa_ptr->sin_addr.s_addr;
+ natlook.af = AF_INET;
+ natlook.saddr.addr32[0] = client_sa_ptr->sin_addr.s_addr;
+ natlook.daddr.addr32[0] = real_server_sa_ptr->sin_addr.s_addr;
natlook.proto = IPPROTO_TCP;
natlook.sport = client_sa_ptr->sin_port;
natlook.dport = real_server_sa_ptr->sin_port;
@@ -135,7 +137,7 @@ get_proxy_env(int connected_fd, struct sockaddr_in *real_server_sa_ptr,
*/
memset((void *)real_server_sa_ptr, 0, sizeof(struct sockaddr_in));
real_server_sa_ptr->sin_port = natlook.rdport;
- real_server_sa_ptr->sin_addr.s_addr = natlook.rdaddr;
+ real_server_sa_ptr->sin_addr.s_addr = natlook.rdaddr.addr32[0];
real_server_sa_ptr->sin_len = sizeof(struct sockaddr_in);
real_server_sa_ptr->sin_family = AF_INET;
return(0);