]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/squid/squid-3.5-14051.patch
unbound: Automatically scale configuration to system
[ipfire-2.x.git] / src / patches / squid / squid-3.5-14051.patch
CommitLineData
b78a8742
MF
1------------------------------------------------------------
2revno: 14051
3revision-id: squid3@treenet.co.nz-20160517145850-uos9z00nrt7xd9ik
4parent: squid3@treenet.co.nz-20160508124125-fytgvn68zppfr8ix
5author: Steve Hill <steve@opendium.com>
6committer: Amos Jeffries <squid3@treenet.co.nz>
7branch nick: 3.5
8timestamp: Wed 2016-05-18 02:58:50 +1200
9message:
10 Support unified EUI format code in external_acl_type
11
12 Squid supports %>eui as a logformat specifier, which produces an EUI-48
13 for IPv4 clients and an EUI-64 for IPv6 clients. However, This is not
14 allowed as a format specifier for the external ACLs, and you have to use
15 %SRCEUI48 and %SRCEUI64 instead. %SRCEUI48 is only useful for IPv4
16 clients and %SRCEUI64 is only useful for IPv6 clients, so supporting
17 both v4 and v6 is a bit messy.
18
19 Adds the %>eui specifier for external ACLs and behaves in the same way
20 as the logformat specifier.
21------------------------------------------------------------
22# Bazaar merge directive format 2 (Bazaar 0.90)
23# revision_id: squid3@treenet.co.nz-20160517145850-uos9z00nrt7xd9ik
24# target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5
25# testament_sha1: ad0743717948a65cfd4f306acc2bbaa9343e9a76
26# timestamp: 2016-05-17 15:50:54 +0000
27# source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5
28# base_revision_id: squid3@treenet.co.nz-20160508124125-\
29# fytgvn68zppfr8ix
30#
31# Begin patch
32=== modified file 'src/external_acl.cc'
33--- src/external_acl.cc 2016-01-01 00:14:27 +0000
34+++ src/external_acl.cc 2016-05-17 14:58:50 +0000
35@@ -356,6 +356,8 @@
36 else if (strcmp(token, "%SRCPORT") == 0 || strcmp(token, "%>p") == 0)
37 format->type = Format::LFT_CLIENT_PORT;
38 #if USE_SQUID_EUI
39+ else if (strcmp(token, "%>eui") == 0)
40+ format->type = Format::LFT_CLIENT_EUI;
41 else if (strcmp(token, "%SRCEUI48") == 0)
42 format->type = Format::LFT_EXT_ACL_CLIENT_EUI48;
43 else if (strcmp(token, "%SRCEUI64") == 0)
44@@ -944,6 +946,18 @@
45 break;
46
47 #if USE_SQUID_EUI
48+ case Format::LFT_CLIENT_EUI:
49+ // TODO make the ACL checklist have a direct link to any TCP details.
50+ if (request->clientConnectionManager.valid() && request->clientConnectionManager->clientConnection != NULL)
51+ {
52+ if (request->clientConnectionManager->clientConnection->remote.isIPv4())
53+ request->clientConnectionManager->clientConnection->remoteEui48.encode(buf, sizeof(buf));
54+ else
55+ request->clientConnectionManager->clientConnection->remoteEui64.encode(buf, sizeof(buf));
56+ str = buf;
57+ }
58+ break;
59+
60 case Format::LFT_EXT_ACL_CLIENT_EUI48:
61 if (request->clientConnectionManager.valid() && request->clientConnectionManager->clientConnection != NULL &&
62 request->clientConnectionManager->clientConnection->remoteEui48.encode(buf, sizeof(buf)))
63