Revision: 14858
Author: adrian.chadd
Date: Sat Jul 2 20:40:06 2011
Log: Convert request_t->out_ip to sqaddr_t.
A few places where this is set (notably the getOutgoingAddr() function)
still only return IPv4 addresses, so an IPv4 address is only going to be
set. This will change in the future as more of the code is taught about
IPv6.
It defaults to IPv4 ANY_ADDR to preserve the previous behaviour.
http://code.google.com/p/lusca-cache/source/detail?r=14858
Modified:
/playpen/LUSCA_HEAD_ipv6/src/HttpRequest.c
/playpen/LUSCA_HEAD_ipv6/src/client_side.c
/playpen/LUSCA_HEAD_ipv6/src/forward.c
/playpen/LUSCA_HEAD_ipv6/src/ssl.c
/playpen/LUSCA_HEAD_ipv6/src/structs.h
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/HttpRequest.c Mon Sep 6 22:29:42 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/HttpRequest.c Sat Jul 2 20:40:06 2011
@@ -57,10 +57,14 @@
stringReset(&req->urlpath, urlpath);
req->max_forwards = -1;
req->lastmod = -1;
- SetAnyAddr(&req->out_ip);
+// SetAnyAddr(&req->out_ip6);
// SetNoAddr(&req->client_addr);
sqinet_init(&req->my_address);
sqinet_init(&req->client_address);
+ sqinet_init(&req->out_ip6);
+ /* Give it some sensible defaults */
+ sqinet_set_family(&req->out_ip6, AF_INET);
+ sqinet_set_anyaddr(&req->out_ip6);
#if FOLLOW_X_FORWARDED_FOR
sqinet_init(&req->indirect_client_address);
#endif
@@ -90,6 +94,7 @@
#if FOLLOW_X_FORWARDED_FOR
sqinet_done(&req->indirect_client_address);
#endif
+ sqinet_done(&req->out_ip6);
stringClean(&req->urlpath);
httpHeaderClean(&req->header);
if (req->cache_control)
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/client_side.c Tue Sep 7 00:36:21 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/client_side.c Sat Jul 2 20:40:06 2011
@@ -272,7 +272,7 @@
if (!http->al.url)
http->al.url = urlCanonicalClean(request);
debug(33, 9) ("httpRequestLog: al.url='%s'\n", http->al.url);
- accessLogEntrySetOutAddr4(&http->al, request->out_ip);
+ accessLogEntrySetOutAddr(&http->al, &request->out_ip6);
if (http->reply && http->log_type != LOG_TCP_DENIED) {
accessLogEntrySetReplyStatus(&http->al, http->reply);
} else if (mem) {
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/forward.c Fri Jul 1 23:10:25 2011
+++ /playpen/LUSCA_HEAD_ipv6/src/forward.c Sat Jul 2 20:40:06 2011
@@ -539,7 +539,10 @@
outgoing = getOutgoingAddr(fwdState->request);
tos = getOutgoingTOS(fwdState->request);
- fwdState->request->out_ip = outgoing;
+
+ /* XXX v4 only! */
+#warning getOutgoingAddr is v4 only!
+ sqinet_set_v4_inaddr(&fwdState->request->out_ip6, &outgoing);
if (fwdState->servers && fwdState->servers->peer &&
fwdState->servers->peer->options.no_tproxy)
do_tproxy = 0;
@@ -796,7 +799,8 @@
fd_table[server_fd].uses++;
if (fd_table[server_fd].uses == 1 && fs->peer)
peerConnectSucceded(fs->peer);
- fwdState->request->out_ip =
sqinet_get_v4_inaddr(&fd_table[server_fd].local_address,
SQADDR_ASSERT_IS_V4);
+ sqinet_copy(&fwdState->request->out_ip6,
+ &fd_table[server_fd].local_address);
netdbPingSite(request->host);
entry->mem_obj->refresh_timestamp = squid_curtime;
if (fwdState->servers && (p = fwdState->servers->peer)) {
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/ssl.c Mon Sep 6 22:29:42 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/ssl.c Sat Jul 2 20:40:06 2011
@@ -521,6 +521,7 @@
debug(26, 3) ("sslStart: '%s %s'\n",
urlMethodGetConstStr(request->method), url);
statCounter.server.all.requests++;
statCounter.server.other.requests++;
+#warning getOutgoingAddr is v4 only!
outgoing = getOutgoingAddr(request);
tos = getOutgoingTOS(request);
/* Create socket. */
@@ -556,7 +557,7 @@
sslState->client.buf = xmalloc(SQUID_TCP_SO_RCVBUF);
/* Copy any pending data from the client connection */
sslState->client.len = http->conn->in.offset;
- sslState->request->out_ip = outgoing;
+ sqinet_set_v4_inaddr(&sslState->request->out_ip6, &outgoing);
if (sslState->client.len > 0) {
if (sslState->client.len > SQUID_TCP_SO_RCVBUF) {
safe_free(sslState->client.buf);
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/structs.h Thu Oct 21 01:45:06 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/structs.h Sat Jul 2 20:40:06 2011
@@ -1671,7 +1671,7 @@
char *peer_domain; /* Configured peer forceddomain */
BODY_HANDLER *body_reader;
void *body_reader_data;
- struct in_addr out_ip;
+ sqaddr_t out_ip6;
String extacl_log; /* String to be used for access.log purposes */
const char *extacl_user; /* User name returned by extacl lookup */
const char *extacl_passwd; /* Password returned by extacl lookup */
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.