Gentoo Archives: gentoo-commits

From: "Alin Nastac (mrness)" <mrness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-proxy/squid/files: squid-2.6.17-gentoo.patch digest-squid-2.6.17 squid-2.6.17-qos.patch squid-2.6.17-ToS_Hit_ToS_Preserve.patch
Date: Tue, 04 Dec 2007 13:04:02
Message-Id: E1IzXRJ-0007qx-Aw@stork.gentoo.org
1 mrness 07/12/04 13:03:53
2
3 Added: squid-2.6.17-gentoo.patch digest-squid-2.6.17
4 squid-2.6.17-qos.patch
5 squid-2.6.17-ToS_Hit_ToS_Preserve.patch
6 Log:
7 Version bump (#201129, #201209).
8 (Portage version: 2.1.3.19)
9
10 Revision Changes Path
11 1.1 net-proxy/squid/files/squid-2.6.17-gentoo.patch
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.17-gentoo.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.17-gentoo.patch?rev=1.1&content-type=text/plain
15
16 Index: squid-2.6.17-gentoo.patch
17 ===================================================================
18 diff -Nru squid-2.6.STABLE17.orig/helpers/basic_auth/MSNT/confload.c squid-2.6.STABLE17/helpers/basic_auth/MSNT/confload.c
19 --- squid-2.6.STABLE17.orig/helpers/basic_auth/MSNT/confload.c 2002-06-26 22:09:48.000000000 +0300
20 +++ squid-2.6.STABLE17/helpers/basic_auth/MSNT/confload.c 2007-12-04 14:29:27.000000000 +0200
21 @@ -24,7 +24,7 @@
22
23 /* Path to configuration file */
24 #ifndef SYSCONFDIR
25 -#define SYSCONFDIR "/usr/local/squid/etc"
26 +#define SYSCONFDIR "/etc/squid"
27 #endif
28 #define CONFIGFILE SYSCONFDIR "/msntauth.conf"
29
30 diff -Nru squid-2.6.STABLE17.orig/helpers/basic_auth/MSNT/msntauth.conf.default squid-2.6.STABLE17/helpers/basic_auth/MSNT/msntauth.conf.default
31 --- squid-2.6.STABLE17.orig/helpers/basic_auth/MSNT/msntauth.conf.default 2002-06-26 21:44:28.000000000 +0300
32 +++ squid-2.6.STABLE17/helpers/basic_auth/MSNT/msntauth.conf.default 2007-12-04 14:29:27.000000000 +0200
33 @@ -8,6 +8,6 @@
34 server other_PDC other_BDC otherdomain
35
36 # Denied and allowed users. Comment these if not needed.
37 -#denyusers /usr/local/squid/etc/msntauth.denyusers
38 -#allowusers /usr/local/squid/etc/msntauth.allowusers
39 +#denyusers /etc/squid/msntauth.denyusers
40 +#allowusers /etc/squid/msntauth.allowusers
41
42 diff -Nru squid-2.6.STABLE17.orig/helpers/basic_auth/SMB/Makefile.am squid-2.6.STABLE17/helpers/basic_auth/SMB/Makefile.am
43 --- squid-2.6.STABLE17.orig/helpers/basic_auth/SMB/Makefile.am 2005-05-17 19:56:26.000000000 +0300
44 +++ squid-2.6.STABLE17/helpers/basic_auth/SMB/Makefile.am 2007-12-04 14:29:27.000000000 +0200
45 @@ -14,7 +14,7 @@
46 ## FIXME: autoconf should test for the samba path.
47
48 SMB_AUTH_HELPER = smb_auth.sh
49 -SAMBAPREFIX=/usr/local/samba
50 +SAMBAPREFIX=/usr
51 SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
52
53 libexec_SCRIPTS = $(SMB_AUTH_HELPER)
54 diff -Nru squid-2.6.STABLE17.orig/helpers/basic_auth/SMB/smb_auth.sh squid-2.6.STABLE17/helpers/basic_auth/SMB/smb_auth.sh
55 --- squid-2.6.STABLE17.orig/helpers/basic_auth/SMB/smb_auth.sh 2001-01-08 01:36:46.000000000 +0200
56 +++ squid-2.6.STABLE17/helpers/basic_auth/SMB/smb_auth.sh 2007-12-04 14:29:27.000000000 +0200
57 @@ -24,7 +24,7 @@
58 read AUTHSHARE
59 read AUTHFILE
60 read SMBUSER
61 -read SMBPASS
62 +read -r SMBPASS
63
64 # Find domain controller
65 echo "Domain name: $DOMAINNAME"
66 @@ -47,7 +47,7 @@
67 addropt=""
68 fi
69 echo "Query address options: $addropt"
70 -dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'`
71 +dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+\..+ / { print $1 ; exit }'`
72 echo "Domain controller IP address: $dcip"
73 [ -n "$dcip" ] || exit 1
74
75 diff -Nru squid-2.6.STABLE17.orig/helpers/external_acl/session/squid_session.8 squid-2.6.STABLE17/helpers/external_acl/session/squid_session.8
76 --- squid-2.6.STABLE17.orig/helpers/external_acl/session/squid_session.8 2007-01-06 19:28:35.000000000 +0200
77 +++ squid-2.6.STABLE17/helpers/external_acl/session/squid_session.8 2007-12-04 14:29:27.000000000 +0200
78 @@ -35,7 +35,7 @@
79 .P
80 Configuration example using the default automatic mode
81 .IP
82 -external_acl_type session ttl=300 negative_ttl=0 children=1 concurrency=200 %LOGIN /usr/local/squid/libexec/squid_session
83 +external_acl_type session ttl=300 negative_ttl=0 children=1 concurrency=200 %LOGIN /usr/libexec/squid/squid_session
84 .IP
85 acl session external session
86 .IP
87 diff -Nru squid-2.6.STABLE17.orig/helpers/external_acl/unix_group/squid_unix_group.8 squid-2.6.STABLE17/helpers/external_acl/unix_group/squid_unix_group.8
88 --- squid-2.6.STABLE17.orig/helpers/external_acl/unix_group/squid_unix_group.8 2006-05-14 18:07:24.000000000 +0300
89 +++ squid-2.6.STABLE17/helpers/external_acl/unix_group/squid_unix_group.8 2007-12-04 14:29:27.000000000 +0200
90 @@ -27,7 +27,7 @@
91 This squid.conf example defines two Squid acls. usergroup1 matches users in group1, and usergroup2
92 matches users in group2 or group3
93 .IP
94 -external_acl_type unix_group %LOGIN /usr/local/squid/libexec/squid_unix_group -p
95 +external_acl_type unix_group %LOGIN /usr/libexec/squid/squid_unix_group -p
96 .IP
97 acl usergroup1 external unix_group group1
98 .IP
99 diff -Nru squid-2.6.STABLE17.orig/src/access_log.c squid-2.6.STABLE17/src/access_log.c
100 --- squid-2.6.STABLE17.orig/src/access_log.c 2007-06-03 03:40:32.000000000 +0300
101 +++ squid-2.6.STABLE17/src/access_log.c 2007-12-04 14:29:27.000000000 +0200
102 @@ -1225,7 +1225,7 @@
103 LogfileStatus = LOG_ENABLE;
104 }
105 #if HEADERS_LOG
106 - headerslog = logfileOpen("/usr/local/squid/logs/headers.log", MAX_URL << 1, 0);
107 + headerslog = logfileOpen("/var/log/squid/headers.log", MAX_URL << 1, 0);
108 assert(NULL != headerslog);
109 #endif
110 #if FORW_VIA_DB
111 diff -Nru squid-2.6.STABLE17.orig/src/cf.data.pre squid-2.6.STABLE17/src/cf.data.pre
112 --- squid-2.6.STABLE17.orig/src/cf.data.pre 2007-11-26 13:03:45.000000000 +0200
113 +++ squid-2.6.STABLE17/src/cf.data.pre 2007-12-04 14:29:27.000000000 +0200
114 @@ -640,6 +640,8 @@
115 acl Safe_ports port 488 # gss-http
116 acl Safe_ports port 591 # filemaker
117 acl Safe_ports port 777 # multiling http
118 +acl Safe_ports port 901 # SWAT
119 +acl purge method PURGE
120 acl CONNECT method CONNECT
121 NOCOMMENT_END
122 DOC_END
123 @@ -673,6 +675,9 @@
124 # Only allow cachemgr access from localhost
125 http_access allow manager localhost
126 http_access deny manager
127 +# Only allow purge requests from localhost
128 +http_access allow purge localhost
129 +http_access deny purge
130 # Deny requests to unknown ports
131 http_access deny !Safe_ports
132 # Deny CONNECT to other than SSL ports
133 @@ -691,6 +696,9 @@
134 #acl our_networks src 192.168.1.0/24 192.168.2.0/24
135 #http_access allow our_networks
136
137 +# Allow the localhost to have access by default
138 +http_access allow localhost
139 +
140 # And finally deny all other access to this proxy
141 http_access deny all
142 NOCOMMENT_END
143 @@ -3356,11 +3364,11 @@
144
145 NAME: cache_mgr
146 TYPE: string
147 -DEFAULT: webmaster
148 +DEFAULT: root
149 LOC: Config.adminEmail
150 DOC_START
151 Email-address of local cache manager who will receive
152 - mail if the cache dies. The default is "webmaster".
153 + mail if the cache dies. The default is "root".
154 DOC_END
155
156 NAME: mail_from
157 @@ -3389,12 +3397,12 @@
158
159 NAME: cache_effective_user
160 TYPE: string
161 -DEFAULT: nobody
162 +DEFAULT: squid
163 LOC: Config.effectiveUser
164 DOC_START
165 If you start Squid as root, it will change its effective/real
166 UID/GID to the user specified below. The default is to change
167 - to UID to nobody. If you define cache_effective_user, but not
168 + to UID to squid. If you define cache_effective_user, but not
169 cache_effective_group, Squid sets the GID to the effective
170 user's default group ID (taken from the password file) and
171 supplementary group list from the from groups membership of
172 @@ -4031,12 +4039,12 @@
173 NAME: snmp_port
174 TYPE: ushort
175 LOC: Config.Port.snmp
176 -DEFAULT: 3401
177 +DEFAULT: 0
178 IFDEF: SQUID_SNMP
179 DOC_START
180 Squid can now serve statistics and status information via SNMP.
181 - By default it listens to port 3401 on the machine. If you don't
182 - wish to use SNMP, set this to "0".
183 + By default snmp_port is disabled. If you wish to use SNMP,
184 + set this to "3401" (or any other number you like).
185 DOC_END
186
187 NAME: snmp_access
188 @@ -4107,12 +4115,12 @@
189 NAME: htcp_port
190 IFDEF: USE_HTCP
191 TYPE: ushort
192 -DEFAULT: 4827
193 +DEFAULT: 0
194 LOC: Config.Port.htcp
195 DOC_START
196 The port number where Squid sends and receives HTCP queries to
197 - and from neighbor caches. Default is 4827. To disable use
198 - "0".
199 + and from neighbor caches. To turn it on you want to set it to
200 + 4827. By default it is set to "0" (disabled).
201 DOC_END
202
203 NAME: log_icp_queries
204 @@ -4964,6 +4972,9 @@
205 If you disable this, it will appear as
206
207 X-Forwarded-For: unknown
208 +NOCOMMENT_START
209 +forwarded_for off
210 +NOCOMMENT_END
211 DOC_END
212
213 NAME: cachemgr_passwd
214 diff -Nru squid-2.6.STABLE17.orig/src/client_side.c squid-2.6.STABLE17/src/client_side.c
215 --- squid-2.6.STABLE17.orig/src/client_side.c 2007-09-03 16:13:36.000000000 +0300
216 +++ squid-2.6.STABLE17/src/client_side.c 2007-12-04 14:29:27.000000000 +0200
217 @@ -4597,14 +4597,7 @@
218 debug(83, 2) ("clientNegotiateSSL: Session %p reused on FD %d (%s:%d)\n", SSL_get_session(ssl), fd, fd_table[fd].ipaddr, (int) fd_table[fd].remote_port);
219 } else {
220 if (do_debug(83, 4)) {
221 - /* Write out the SSL session details.. actually the call below, but
222 - * OpenSSL headers do strange typecasts confusing GCC.. */
223 - /* PEM_write_SSL_SESSION(debug_log, SSL_get_session(ssl)); */
224 -#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x00908000L
225 - PEM_ASN1_write((i2d_of_void *) i2d_SSL_SESSION, PEM_STRING_SSL_SESSION, debug_log, (char *) SSL_get_session(ssl), NULL, NULL, 0, NULL, NULL);
226 -#else
227 PEM_ASN1_write(i2d_SSL_SESSION, PEM_STRING_SSL_SESSION, debug_log, (char *) SSL_get_session(ssl), NULL, NULL, 0, NULL, NULL);
228 -#endif
229 /* Note: This does not automatically fflush the log file.. */
230 }
231 debug(83, 2) ("clientNegotiateSSL: New session %p on FD %d (%s:%d)\n", SSL_get_session(ssl), fd, fd_table[fd].ipaddr, (int) fd_table[fd].remote_port);
232 diff -Nru squid-2.6.STABLE17.orig/src/defines.h squid-2.6.STABLE17/src/defines.h
233 --- squid-2.6.STABLE17.orig/src/defines.h 2007-02-04 00:58:20.000000000 +0200
234 +++ squid-2.6.STABLE17/src/defines.h 2007-12-04 14:29:27.000000000 +0200
235 @@ -259,7 +259,7 @@
236
237 /* were to look for errors if config path fails */
238 #ifndef DEFAULT_SQUID_ERROR_DIR
239 -#define DEFAULT_SQUID_ERROR_DIR "/usr/local/squid/etc/errors"
240 +#define DEFAULT_SQUID_ERROR_DIR "/usr/share/squid/errors/English"
241 #endif
242
243 /* gb_type operations */
244 diff -Nru squid-2.6.STABLE17.orig/src/main.c squid-2.6.STABLE17/src/main.c
245 --- squid-2.6.STABLE17.orig/src/main.c 2007-11-26 12:47:23.000000000 +0200
246 +++ squid-2.6.STABLE17/src/main.c 2007-12-04 14:29:27.000000000 +0200
247 @@ -372,6 +372,22 @@
248 asnFreeMemory();
249 }
250
251 +#if USE_UNLINKD
252 +static int
253 +needUnlinkd(void)
254 +{
255 + int i;
256 + int r = 0;
257 + for (i = 0; i < Config.cacheSwap.n_configured; i++) {
258 + if (strcmp(Config.cacheSwap.swapDirs[i].type, "ufs") == 0 ||
259 + strcmp(Config.cacheSwap.swapDirs[i].type, "aufs") == 0 ||
260 + strcmp(Config.cacheSwap.swapDirs[i].type, "diskd") == 0)
261 + r++;
262 + }
263 + return r;
264 +}
265 +#endif
266 +
267 static void
268 mainReconfigure(void)
269 {
270 @@ -395,6 +411,7 @@
271 locationRewriteShutdown();
272 authenticateShutdown();
273 externalAclShutdown();
274 + unlinkdClose();
275 storeDirCloseSwapLogs();
276 storeLogClose();
277 accessLogClose();
278 @@ -430,6 +447,9 @@
279 #if USE_WCCPv2
280 wccp2Init();
281 #endif
282 +#if USE_UNLINKD
283 + if (needUnlinkd()) unlinkdInit();
284 +#endif
285 serverConnectionsOpen();
286 neighbors_init();
287 storeDirOpenSwapLogs();
288 @@ -593,7 +613,7 @@
289
290 if (!configured_once) {
291 #if USE_UNLINKD
292 - unlinkdInit();
293 + if (needUnlinkd()) unlinkdInit();
294 #endif
295 urlInitialize();
296 cachemgrInit();
297 diff -Nru squid-2.6.STABLE17.orig/src/Makefile.am squid-2.6.STABLE17/src/Makefile.am
298 --- squid-2.6.STABLE17.orig/src/Makefile.am 2007-09-06 00:50:15.000000000 +0300
299 +++ squid-2.6.STABLE17/src/Makefile.am 2007-12-04 14:29:27.000000000 +0200
300 @@ -325,12 +325,12 @@
301 DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf
302 DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf
303 DEFAULT_DNSSERVER = $(libexecdir)/`echo dnsserver | sed '$(transform);s/$$/$(EXEEXT)/'`
304 -DEFAULT_LOG_PREFIX = $(localstatedir)/logs
305 +DEFAULT_LOG_PREFIX = $(localstatedir)/log/squid
306 DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log
307 DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log
308 DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log
309 -DEFAULT_PID_FILE = $(DEFAULT_LOG_PREFIX)/squid.pid
310 -DEFAULT_SWAP_DIR = $(localstatedir)/cache
311 +DEFAULT_PID_FILE = $(localstatedir)/run/squid.pid
312 +DEFAULT_SWAP_DIR = $(localstatedir)/cache/squid
313 DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
314 DEFAULT_UNLINKD = $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'`
315 DEFAULT_DISKD = $(libexecdir)/`echo diskd-daemon | sed '$(transform);s/$$/$(EXEEXT)/'`
316
317
318
319 1.1 net-proxy/squid/files/digest-squid-2.6.17
320
321 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/digest-squid-2.6.17?rev=1.1&view=markup
322 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/digest-squid-2.6.17?rev=1.1&content-type=text/plain
323
324 Index: digest-squid-2.6.17
325 ===================================================================
326 MD5 f3e5c7721d9f8d8f25ecb337f6f88b73 squid-2.6.STABLE17.tar.gz 1724676
327 RMD160 8fadcf6a78c0f8ce20426ed9a78837e19a0a9af6 squid-2.6.STABLE17.tar.gz 1724676
328 SHA256 01231f7eb0a28faff41f3f279b949f32602ae4fce41d26f6190e9812fe2a360c squid-2.6.STABLE17.tar.gz 1724676
329
330
331
332 1.1 net-proxy/squid/files/squid-2.6.17-qos.patch
333
334 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.17-qos.patch?rev=1.1&view=markup
335 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.17-qos.patch?rev=1.1&content-type=text/plain
336
337 Index: squid-2.6.17-qos.patch
338 ===================================================================
339 diff -Nru squid-2.6.STABLE17.orig/src/cache_cf.c squid-2.6.STABLE17/src/cache_cf.c
340 --- squid-2.6.STABLE17.orig/src/cache_cf.c 2007-08-31 16:49:54.000000000 +0300
341 +++ squid-2.6.STABLE17/src/cache_cf.c 2007-12-04 14:38:58.000000000 +0200
342 @@ -891,6 +891,65 @@
343 }
344 }
345
346 +CBDATA_TYPE(acl_priority);
347 +
348 +static void
349 +dump_acl_priority(StoreEntry * entry, const char *name, acl_priority * head)
350 +{
351 + acl_priority *l;
352 + for (l = head; l; l = l->next) {
353 + if (l->priority > 0)
354 + storeAppendPrintf(entry, "%s %04X:%04X", name,
355 + l->priority >> 16, l->priority & 0xFFFF);
356 + else
357 + storeAppendPrintf(entry, "%s none", name);
358 + dump_acl_list(entry, l->acl_list);
359 + storeAppendPrintf(entry, "\n");
360 + }
361 +}
362 +
363 +static void
364 +freed_acl_priority(void *data)
365 +{
366 + acl_priority *l = data;
367 + aclDestroyAclList(&l->acl_list);
368 +}
369 +
370 +static void
371 +parse_acl_priority(acl_priority ** head)
372 +{
373 + acl_priority *l;
374 + acl_priority **tail = head; /* sane name below */
375 + unsigned long priority, t1, t2;
376 + char junk;
377 + char *token = strtok(NULL, w_space);
378 + if (!token)
379 + self_destruct();
380 + if (sscanf(token, "%x:%x%c", &t1, &t2, &junk) != 2)
381 + self_destruct();
382 + if (t1 < 0 || t1 > 0xFFFF || t2 < 0 || t2 > 0xFFFF)
383 + self_destruct();
384 + priority = t1 << 16 | t2;
385 + CBDATA_INIT_TYPE_FREECB(acl_priority, freed_acl_priority);
386 + l = cbdataAlloc(acl_priority);
387 + l->priority = priority;
388 + aclParseAclList(&l->acl_list);
389 + while (*tail)
390 + tail = &(*tail)->next;
391 + *tail = l;
392 +}
393 +
394 +static void
395 +free_acl_priority(acl_priority ** head)
396 +{
397 + while (*head) {
398 + acl_priority *l = *head;
399 + *head = l->next;
400 + l->next = NULL;
401 + cbdataFree(l);
402 + }
403 +}
404 +
405 #if DELAY_POOLS
406
407 /* do nothing - free_delay_pool_count is the magic free function.
408 diff -Nru squid-2.6.STABLE17.orig/src/cf.data.depend squid-2.6.STABLE17/src/cf.data.depend
409 --- squid-2.6.STABLE17.orig/src/cf.data.depend 2007-09-06 00:50:15.000000000 +0300
410 +++ squid-2.6.STABLE17/src/cf.data.depend 2007-12-04 14:38:58.000000000 +0200
411 @@ -5,6 +5,7 @@
412 acl_address acl
413 acl_b_size_t acl
414 acl_tos acl
415 +acl_priority acl
416 address
417 authparam
418 b_int64_t
419 diff -Nru squid-2.6.STABLE17.orig/src/cf.data.pre squid-2.6.STABLE17/src/cf.data.pre
420 --- squid-2.6.STABLE17.orig/src/cf.data.pre 2007-12-04 14:38:45.000000000 +0200
421 +++ squid-2.6.STABLE17/src/cf.data.pre 2007-12-04 14:38:58.000000000 +0200
422 @@ -1239,6 +1239,27 @@
423 Default: 255 (TOS from server is not changed).
424 DOC_END
425
426 +NAME: tcp_outgoing_priority
427 +TYPE: acl_priority
428 +DEFAULT: none
429 +LOC: Config.accessList.outgoing_priority
430 +DOC_START
431 + Allows you to select the priority of the outgoing connection,
432 + based on the username or source address making the request. The
433 + priority can be used by Linux QoS Qdiscs for classification.
434 +
435 + tcp_outgoing_priority priority [!]aclname ...
436 +
437 + Example where requests from special_service_net are assigned
438 + priority 10:100
439 +
440 + acl special_service_net src 10.0.0.0/255.255.255.0
441 + tcp_outgoing_priority 10:100 special_service_net
442 +
443 + Processing proceeds in the order specified, and stops at first fully
444 + matching line.
445 +DOC_END
446 +
447 NAME: tcp_outgoing_address
448 TYPE: acl_address
449 DEFAULT: none
450 diff -Nru squid-2.6.STABLE17.orig/src/comm.c squid-2.6.STABLE17/src/comm.c
451 --- squid-2.6.STABLE17.orig/src/comm.c 2007-04-17 12:39:56.000000000 +0300
452 +++ squid-2.6.STABLE17/src/comm.c 2007-12-04 14:38:58.000000000 +0200
453 @@ -162,7 +162,7 @@
454 int flags,
455 const char *note)
456 {
457 - return comm_openex(sock_type, proto, addr, port, flags, 0, note);
458 + return comm_openex(sock_type, proto, addr, port, flags, 0, 0, note);
459 }
460
461
462 @@ -175,10 +175,12 @@
463 u_short port,
464 int flags,
465 unsigned char TOS,
466 + unsigned long PRIORITY,
467 const char *note)
468 {
469 int new_socket;
470 int tos = 0;
471 + unsigned long priority = 0;
472 fde *F = NULL;
473
474 /* Create socket for accepting new connections. */
475 @@ -209,12 +211,25 @@
476 debug(5, 0) ("comm_open: setsockopt(IP_TOS) not supported on this platform\n");
477 #endif
478 }
479 + if (PRIORITY) {
480 +#ifdef SO_PRIORITY
481 + priority = PRIORITY;
482 + enter_suid();
483 + if (setsockopt(new_socket, SOL_SOCKET, SO_PRIORITY, (char *) &priority, sizeof(unsigned long)) < 0)
484 + debug(50, 1) ("comm_open: setsockopt(SO_PRIORITY) on FD %d: %s\n",
485 + new_socket, xstrerror());
486 + leave_suid();
487 +#else
488 + debug(50, 0) ("comm_open: setsockopt(SO_PRIORITY) not supported on this platform\n");
489 +#endif
490 + }
491 /* update fdstat */
492 debug(5, 5) ("comm_open: FD %d is a new socket\n", new_socket);
493 fd_open(new_socket, FD_SOCKET, note);
494 F = &fd_table[new_socket];
495 F->local_addr = addr;
496 F->tos = tos;
497 + F->priority = priority;
498 if (!(flags & COMM_NOCLOEXEC))
499 commSetCloseOnExec(new_socket);
500 if ((flags & COMM_REUSEADDR))
501 @@ -382,6 +397,15 @@
502 debug(5, 1) ("commResetFD: setsockopt(IP_TOS) on FD %d: %s\n", cs->fd, xstrerror());
503 }
504 #endif
505 +#ifdef SO_PRIORITY
506 + if (F->priority) {
507 + unsigned long priority = F->priority;
508 + enter_suid();
509 + if (setsockopt(cs->fd, SOL_SOCKET, SO_PRIORITY, (char *)&priority, sizeof(unsigned long)) < 0)
510 + debug(50, 1) ("commResetFD: setsockopt(SO_PRIORITY) on FD %d: %s\n", cs->fd, xstrerror());
511 + leave_suid();
512 + }
513 +#endif
514 if (F->flags.close_on_exec)
515 commSetCloseOnExec(cs->fd);
516 if (F->flags.nonblocking)
517 diff -Nru squid-2.6.STABLE17.orig/src/forward.c squid-2.6.STABLE17/src/forward.c
518 --- squid-2.6.STABLE17.orig/src/forward.c 2007-09-06 00:28:34.000000000 +0300
519 +++ squid-2.6.STABLE17/src/forward.c 2007-12-04 14:38:58.000000000 +0200
520 @@ -418,6 +418,17 @@
521 return 0;
522 }
523
524 +static unsigned long
525 +aclMapPriority(acl_priority * head, aclCheck_t * ch)
526 +{
527 + acl_priority *l;
528 + for (l = head; l; l = l->next) {
529 + if (aclMatchAclList(l->acl_list, ch))
530 + return l->priority;
531 + }
532 + return 0;
533 +}
534 +
535 struct in_addr
536 getOutgoingAddr(request_t * request)
537 {
538 @@ -446,6 +457,20 @@
539 return aclMapTOS(Config.accessList.outgoing_tos, &ch);
540 }
541
542 +unsigned long
543 +getOutgoingPriority(request_t * request)
544 +{
545 + aclCheck_t ch;
546 + memset(&ch, '\0', sizeof(aclCheck_t));
547 + if (request) {
548 + ch.src_addr = request->client_addr;
549 + ch.my_addr = request->my_addr;
550 + ch.my_port = request->my_port;
551 + ch.request = request;
552 + }
553 + return aclMapPriority(Config.accessList.outgoing_priority, &ch);
554 +}
555 +
556 static void
557 fwdConnectStart(void *data)
558 {
559 @@ -462,6 +487,7 @@
560 int ftimeout = Config.Timeout.forward - (squid_curtime - fwdState->start);
561 struct in_addr outgoing;
562 unsigned short tos;
563 + unsigned long priority;
564 #if LINUX_TPROXY
565 struct in_tproxy itp;
566 #endif
567 @@ -547,15 +573,17 @@
568 #endif
569 outgoing = getOutgoingAddr(fwdState->request);
570 tos = getOutgoingTOS(fwdState->request);
571 + priority = getOutgoingPriority(fwdState->request);
572
573 - debug(17, 3) ("fwdConnectStart: got addr %s, tos %d\n",
574 - inet_ntoa(outgoing), tos);
575 + debug(17, 3) ("fwdConnectStart: got addr %s, tos %d, priority %lu\n",
576 + inet_ntoa(outgoing), tos, priority);
577 fd = comm_openex(SOCK_STREAM,
578 IPPROTO_TCP,
579 outgoing,
580 0,
581 COMM_NONBLOCKING,
582 tos,
583 + priority,
584 url);
585 if (fd < 0) {
586 debug(50, 4) ("fwdConnectStart: %s\n", xstrerror());
587 diff -Nru squid-2.6.STABLE17.orig/src/protos.h squid-2.6.STABLE17/src/protos.h
588 --- squid-2.6.STABLE17.orig/src/protos.h 2007-07-15 12:52:17.000000000 +0300
589 +++ squid-2.6.STABLE17/src/protos.h 2007-12-04 14:38:58.000000000 +0200
590 @@ -160,7 +160,7 @@
591 extern void comm_init(void);
592 extern int comm_listen(int sock);
593 extern int comm_open(int, int, struct in_addr, u_short port, int, const char *note);
594 -extern int comm_openex(int, int, struct in_addr, u_short, int, unsigned char TOS, const char *);
595 +extern int comm_openex(int, int, struct in_addr, u_short, int, unsigned char TOS, unsigned long PRIORITY, const char *);
596 extern u_short comm_local_port(int fd);
597
598 extern void commDeferFD(int fd);
599 @@ -735,6 +735,7 @@
600 #endif
601 struct in_addr getOutgoingAddr(request_t * request);
602 unsigned long getOutgoingTOS(request_t * request);
603 +unsigned long getOutgoingPriority(request_t * request);
604
605 extern void urnStart(request_t *, StoreEntry *);
606
607 diff -Nru squid-2.6.STABLE17.orig/src/ssl.c squid-2.6.STABLE17/src/ssl.c
608 --- squid-2.6.STABLE17.orig/src/ssl.c 2007-02-03 23:53:38.000000000 +0200
609 +++ squid-2.6.STABLE17/src/ssl.c 2007-12-04 14:38:58.000000000 +0200
610 @@ -524,6 +524,7 @@
611 0,
612 COMM_NONBLOCKING,
613 getOutgoingTOS(request),
614 ++ getOutgoingPriority(request),
615 url);
616 if (sock == COMM_ERROR) {
617 debug(26, 4) ("sslStart: Failed because we're out of sockets.\n");
618 diff -Nru squid-2.6.STABLE17.orig/src/structs.h squid-2.6.STABLE17/src/structs.h
619 --- squid-2.6.STABLE17.orig/src/structs.h 2007-12-04 14:38:45.000000000 +0200
620 +++ squid-2.6.STABLE17/src/structs.h 2007-12-04 14:38:58.000000000 +0200
621 @@ -296,6 +296,12 @@
622 int tos;
623 };
624
625 +struct _acl_priority {
626 + acl_priority *next;
627 + acl_list *acl_list;
628 + unsigned long priority;
629 +};
630 +
631 struct _aclCheck_t {
632 const acl_access *access_list;
633 struct in_addr src_addr;
634 @@ -705,6 +711,7 @@
635 acl_access *reply;
636 acl_address *outgoing_address;
637 acl_tos *outgoing_tos;
638 + acl_priority *outgoing_priority;
639 #if USE_HTCP
640 acl_access *htcp;
641 acl_access *htcp_clr;
642 @@ -876,6 +883,7 @@
643 u_short remote_port;
644 struct in_addr local_addr;
645 unsigned char tos;
646 + unsigned long priority;
647 char ipaddr[16]; /* dotted decimal address of peer */
648 char desc[FD_DESC_SZ];
649 struct {
650 diff -Nru squid-2.6.STABLE17.orig/src/typedefs.h squid-2.6.STABLE17/src/typedefs.h
651 --- squid-2.6.STABLE17.orig/src/typedefs.h 2006-09-02 17:08:42.000000000 +0300
652 +++ squid-2.6.STABLE17/src/typedefs.h 2007-12-04 14:38:58.000000000 +0200
653 @@ -102,6 +102,7 @@
654 typedef struct _acl_access acl_access;
655 typedef struct _acl_address acl_address;
656 typedef struct _acl_tos acl_tos;
657 +typedef struct _acl_priority acl_priority;
658 typedef struct _aclCheck_t aclCheck_t;
659 typedef struct _wordlist wordlist;
660 typedef struct _intlist intlist;
661
662
663
664 1.1 net-proxy/squid/files/squid-2.6.17-ToS_Hit_ToS_Preserve.patch
665
666 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.17-ToS_Hit_ToS_Preserve.patch?rev=1.1&view=markup
667 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.17-ToS_Hit_ToS_Preserve.patch?rev=1.1&content-type=text/plain
668
669 Index: squid-2.6.17-ToS_Hit_ToS_Preserve.patch
670 ===================================================================
671 diff -Nru squid-2.6.STABLE17.orig/src/cf.data.pre squid-2.6.STABLE17/src/cf.data.pre
672 --- squid-2.6.STABLE17.orig/src/cf.data.pre 2007-12-04 14:33:41.000000000 +0200
673 +++ squid-2.6.STABLE17/src/cf.data.pre 2007-12-04 14:37:55.000000000 +0200
674 @@ -1181,6 +1181,64 @@
675 to off when using this directive in such configurations.
676 DOC_END
677
678 +NAME: zph_tos_local
679 +TYPE: int
680 +DEFAULT: 0
681 +LOC: Config.zph_tos_local
682 +DOC_START
683 + Allows you to select a TOS/Diffserv value to mark local hits. Read above
684 + (tcp_outgoing_tos) for details/requirements about TOS.
685 + Default: 0 (disabled).
686 +DOC_END
687 +
688 +NAME: zph_tos_peer
689 +TYPE: int
690 +DEFAULT: 0
691 +LOC: Config.zph_tos_peer
692 +DOC_START
693 + Allows you to select a TOS/Diffserv value to mark peer hits. Read above
694 + (tcp_outgoing_tos) for details/requirements about TOS.
695 + Default: 0 (disabled).
696 +DOC_END
697 +
698 +NAME: zph_tos_parent
699 +COMMENT: on|off
700 +TYPE: onoff
701 +LOC: Config.onoff.zph_tos_parent
702 +DEFAULT: on
703 +DOC_START
704 + Set this to off if you want only sibling hits to be marked.
705 + If set to on (default), parent hits are being marked too.
706 +DOC_END
707 +
708 +NAME: zph_preserve_miss_tos
709 +COMMENT: on|off
710 +TYPE: onoff
711 +LOC: Config.onoff.zph_preserve_miss_tos
712 +DEFAULT: on
713 +DOC_START
714 + If set to on (default), any HTTP response towards clients will
715 + have the TOS value of the response comming from the remote
716 + server masked with the value of zph_preserve_miss_tos_mask.
717 + For this to work correctly, you will need to patch your linux
718 + kernel with the TOS preserving ZPH patch.
719 + Has no effect under FreeBSD, works only under linux ZPH patched
720 + kernels.
721 +DOC_END
722 +
723 +NAME: zph_preserve_miss_tos_mask
724 +TYPE: int
725 +DEFAULT: 255
726 +LOC: Config.zph_preserve_miss_tos_mask
727 +DOC_START
728 + Allows you to mask certain bits in the TOS received from the
729 + remote server, before copying the value to the TOS send towards
730 + clients.
731 + See zph_preserve_miss_tos for details.
732 +
733 + Default: 255 (TOS from server is not changed).
734 +DOC_END
735 +
736 NAME: tcp_outgoing_address
737 TYPE: acl_address
738 DEFAULT: none
739 diff -Nru squid-2.6.STABLE17.orig/src/client_side.c squid-2.6.STABLE17/src/client_side.c
740 --- squid-2.6.STABLE17.orig/src/client_side.c 2007-12-04 14:33:41.000000000 +0200
741 +++ squid-2.6.STABLE17/src/client_side.c 2007-12-04 14:37:55.000000000 +0200
742 @@ -2632,6 +2632,55 @@
743 return;
744 }
745 assert(http->out.offset == 0);
746 +
747 + if ( Config.zph_tos_local || Config.zph_tos_peer ||
748 + (Config.onoff.zph_preserve_miss_tos && Config.zph_preserve_miss_tos_mask) )
749 + {
750 + int need_change = 0;
751 + int hit = 0;
752 + int tos = 0;
753 + int tos_old = 0;
754 + int tos_len = sizeof(tos_old);
755 + int res;
756 +
757 + if (Config.zph_tos_local && isTcpHit(http->log_type)) { /* local hit */
758 + hit = 1;
759 + tos = Config.zph_tos_local;
760 + } else if (Config.zph_tos_peer &&
761 + (http->request->hier.code == SIBLING_HIT || /* sibling hit */
762 + (Config.onoff.zph_tos_parent &&
763 + http->request->hier.code == PARENT_HIT))) { /* parent hit */
764 + hit = 1;
765 + tos = Config.zph_tos_peer;
766 + }
767 + if (http->request->flags.proxy_keepalive) {
768 + if (getsockopt(fd, IPPROTO_IP, IP_TOS, &tos_old, &tos_len) < 0) {
769 + debug(33, 1) ("ZPH: getsockopt(IP_TOS) on FD %d: %s\n", fd, xstrerror());
770 + } else if (hit && tos_old != tos) { /* HIT: 1-st request, or previous was MISS, */
771 + need_change = 1; /* or local/parent hit change */
772 + } else if (!hit && (tos_old || /* MISS: previous was HIT */
773 + Config.onoff.zph_preserve_miss_tos)) { /* TOS copying is on */
774 +#if defined(_SQUID_LINUX_)
775 + if ( Config.onoff.zph_preserve_miss_tos ) {
776 + tos = (entry->mem_obj != NULL) ?
777 + (entry->mem_obj->recvTOS & Config.zph_preserve_miss_tos_mask):0;
778 + } else tos = 0;
779 +#else
780 + tos = 0;
781 +#endif
782 + need_change = 1;
783 + }
784 + } else if (hit) { /* no keepalive */
785 + need_change = 1;
786 + }
787 + if (need_change) {
788 + if (!hit) enter_suid(); /* Setting TOS bit6-7 is privilleged */
789 + res = setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
790 + if (!hit) leave_suid(); /* Setting bit5-7 is privilleged */
791 + if ( res < 0)
792 + debug(33, 1) ("ZPH: setsockopt(IP_TOS) on FD %d: %s\n", fd, xstrerror());
793 + }
794 + }
795 rep = http->reply = clientBuildReply(http, buf, size);
796 if (!rep) {
797 /* Forward as HTTP/0.9 body with no reply */
798 diff -Nru squid-2.6.STABLE17.orig/src/http.c squid-2.6.STABLE17/src/http.c
799 --- squid-2.6.STABLE17.orig/src/http.c 2007-11-26 13:04:30.000000000 +0200
800 +++ squid-2.6.STABLE17/src/http.c 2007-12-04 14:37:55.000000000 +0200
801 @@ -1393,6 +1393,53 @@
802 peer *p = httpState->peer;
803 CWCB *sendHeaderDone;
804 int fd = httpState->fd;
805 +
806 +#if defined(_SQUID_LINUX_)
807 +/* ZPH patch starts here (M.Stavrev 25-05-2005)
808 + * Retrieve connection peer's TOS value (which its SYN_ACK TCP segment
809 + * was encapsulated into an IP packet)
810 + */
811 + int tos, tos_len;
812 + if ( entry && entry->mem_obj ) { // Is this check necessary ? Seems not, but
813 + // have no time to investigate further.
814 + entry->mem_obj->recvTOS = 0;
815 + tos = 1;
816 + tos_len = sizeof(tos);
817 + if ( setsockopt(fd,SOL_IP, IP_RECVTOS, &tos, tos_len) == 0 ) {
818 + unsigned char buf[128];
819 + int len = 128;
820 + if (getsockopt(fd, SOL_IP, IP_PKTOPTIONS, buf, &len) == 0)
821 + {
822 + /* Parse the PKTOPTIONS structure to locate the TOS data message
823 + * prepared in the kernel by the ZPH incoming TCP TOS preserving
824 + * patch. In 99,99% the TOS should be located at buf[12], but
825 + * let's do it the right way.
826 + */
827 + unsigned char * p = buf;
828 + while ( p-buf < len ) {
829 + struct cmsghdr * o = (struct cmsghdr*)p;
830 + if ( o->cmsg_len <= 0 || o->cmsg_len > 52 )
831 + break;
832 + if ( o->cmsg_level == SOL_IP && o->cmsg_type == IP_TOS ) {
833 + entry->mem_obj->recvTOS = (unsigned char)(*(int*)
834 + (p + sizeof(struct cmsghdr)));
835 + debug(11, 5) ("ZPH: Incomming TOS=%d on FD %d\n",
836 + entry->mem_obj->recvTOS, fd );
837 + break;
838 + }
839 + p += o->cmsg_len;
840 + }
841 + } else {
842 + debug(11, 5) ("ZPH: getsockopt(IP_PKTOPTIONS) on FD %d: %s\n",
843 + fd, xstrerror());
844 + }
845 + } else {
846 + debug(11, 5) ("ZPH: setsockopt(IP_RECVTOS) on FD %d: %s\n",
847 + fd, xstrerror());
848 + }
849 + }
850 +/* ZPH patch ends here */
851 +#endif
852
853 debug(11, 5) ("httpSendRequest: FD %d: httpState %p.\n", fd, httpState);
854
855 diff -Nru squid-2.6.STABLE17.orig/src/structs.h squid-2.6.STABLE17/src/structs.h
856 --- squid-2.6.STABLE17.orig/src/structs.h 2007-09-06 00:28:34.000000000 +0300
857 +++ squid-2.6.STABLE17/src/structs.h 2007-12-04 14:37:55.000000000 +0200
858 @@ -669,6 +669,8 @@
859 int relaxed_header_parser;
860 int accel_no_pmtu_disc;
861 int global_internal_static;
862 + int zph_tos_parent;
863 + int zph_preserve_miss_tos;
864 int httpd_suppress_version_string;
865 int via;
866 int check_hostnames;
867 @@ -793,6 +795,9 @@
868 int sleep_after_fork; /* microseconds */
869 time_t minimum_expiry_time; /* seconds */
870 external_acl *externalAclHelperList;
871 + int zph_tos_local;
872 + int zph_tos_peer;
873 + int zph_preserve_miss_tos_mask;
874 errormap *errorMapList;
875 #if USE_SSL
876 struct {
877 @@ -1724,6 +1729,9 @@
878 const char *vary_encoding;
879 StoreEntry *ims_entry;
880 time_t refresh_timestamp;
881 +#if defined(_SQUID_LINUX_)
882 + unsigned char recvTOS; /* ZPH patch - stores remote server's TOS */
883 +#endif
884 };
885
886 struct _StoreEntry {
887
888
889
890 --
891 gentoo-commits@g.o mailing list