--------------------- PatchSet 1867 Date: 2001/04/10 11:52:20 Author: rvenning Branch: rvenning_tosaddracl Tag: (none) Log: bug fixed some stupidity in the a debug statement. Also changed the type of trailer to unsigned long due to concerns about portability. I'm not sure whether this will the problem that Joao had seen with the acl.c safe_inet_addr returning the first byte of the address only, the rest zeroes. His fix was to use inet_addr on the inside of the if, but this will not let the ToS patch work. Fixed the missing 'allow' that is required now. Members: src/acl.c:1.28.2.1->1.28.2.2 src/cf.data.pre:1.24.2.2->1.24.2.3 src/forward.c:1.12.2.2->1.12.2.3 src/structs.h:1.28.2.2->1.28.2.3 Index: squid/src/acl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/acl.c,v retrieving revision 1.28.2.1 retrieving revision 1.28.2.2 diff -u -r1.28.2.1 -r1.28.2.2 --- squid/src/acl.c 1 Apr 2001 10:34:09 -0000 1.28.2.1 +++ squid/src/acl.c 10 Apr 2001 11:52:20 -0000 1.28.2.2 @@ -1,6 +1,6 @@ /* - * $Id: acl.c,v 1.28.2.1 2001/04/01 10:34:09 rvenning Exp $ + * $Id: acl.c,v 1.28.2.2 2001/04/10 11:52:20 rvenning Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -994,12 +994,12 @@ debug(28, 3) ("aclParseAccessLine: looking for ACL name '%s'\n", t); a = aclFindByName(t); if (a == NULL) { - int trailer; - /* maybe it is a permissible trailing integer - in which case there - is nothing left on the line */ + unsigned long trailer; + /* maybe it is a permissible trailing integer or dotted quad + - in which case there is nothing else left on the line */ if (!strtok(NULL, w_space) && /* OK to discard, trust me */ (sscanf(t, "0x%x", &trailer) || sscanf(t, "%d", &trailer) || - safe_inet_addr(t, (struct in_addr *)&trailer))) { + inet_addr(t, (struct in_addr *)&trailer))) { /* we really do have a int on the end of the line, in 0x1234 or plain 1234 format */ A->trailer = trailer; Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v retrieving revision 1.24.2.2 retrieving revision 1.24.2.3 diff -u -r1.24.2.2 -r1.24.2.3 --- squid/src/cf.data.pre 1 Apr 2001 11:11:38 -0000 1.24.2.2 +++ squid/src/cf.data.pre 10 Apr 2001 11:52:20 -0000 1.24.2.3 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.24.2.2 2001/04/01 11:11:38 rvenning Exp $ +# $Id: cf.data.pre,v 1.24.2.3 2001/04/10 11:52:20 rvenning Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -2084,8 +2084,8 @@ acl normal_service_net src 10.0.0.0/255.255.255.0 acl good_service_net src 10.0.1.0/255.255.255.0 - acl_map2_tos normal_service_net 0x00 - acl_map2_tos good_service_net 0x20 + acl_map2_tos allow normal_service_net 0x00 + acl_map2_tos allow good_service_net 0x20 TOS/DSCP values really only have local significance - so you should know what you're specifying. For more, see RFC 2474 @@ -2106,13 +2106,13 @@ the outgoing address, unlike TOS markings, which may dissappear on the reverse path. The idea is you have another bandwidth controlling box to limit bandwidth by IP address within your - network. Note: you're machine must have the addresses you choose + network. Note: your machine must have the addresses you choose assigned. An example: acl normal_service_net src 10.0.0.0/255.255.255.0 acl good_service_net src 10.0.1.0/255.255.255.0 - acl_map2_outgoing normal_service_net 10.0.0.1 - acl_map2_outgoing good_service_net 10.0.0.2 + acl_map2_outgoing allow normal_service_net 10.0.0.1 + acl_map2_outgoing allow good_service_net 10.0.0.2 DOC_END COMMENT_START Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.12.2.2 retrieving revision 1.12.2.3 diff -u -r1.12.2.2 -r1.12.2.3 --- squid/src/forward.c 1 Apr 2001 11:11:38 -0000 1.12.2.2 +++ squid/src/forward.c 10 Apr 2001 11:52:20 -0000 1.12.2.3 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.12.2.2 2001/04/01 11:11:38 rvenning Exp $ + * $Id: forward.c,v 1.12.2.3 2001/04/10 11:52:20 rvenning Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -322,7 +322,8 @@ /* and the desired tos (for the request that sparked this connection) */ tos = (unsigned short)aclCheckFast(Config.accessList.tosacl, &ch); - debug(17,3) ("fwdConnectStart: got addr %s, tos %d\n", outgoing, tos); + debug(17,3) ("fwdConnectStart: got addr %s, tos %d\n", + inet_ntoa(outgoing), tos); fd = comm_openex(SOCK_STREAM, 0, outgoing, Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.28.2.2 retrieving revision 1.28.2.3 diff -u -r1.28.2.2 -r1.28.2.3 --- squid/src/structs.h 1 Apr 2001 11:11:38 -0000 1.28.2.2 +++ squid/src/structs.h 10 Apr 2001 11:52:20 -0000 1.28.2.3 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.28.2.2 2001/04/01 11:11:38 rvenning Exp $ + * $Id: structs.h,v 1.28.2.3 2001/04/10 11:52:20 rvenning Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -235,7 +235,7 @@ struct _acl_access { int allow; - int trailer; + unsigned long trailer; acl_list *acl_list; char *cfgline; acl_access *next;