--------------------- PatchSet 8797 Date: 2006/12/05 13:45:50 Author: adri Branch: adrian Tag: (none) Log: The mask assignment code was segfaulting in its current form; it was overflowing after the last valid hash value was used. Members: src/wccp2.c:1.26->1.26.4.1 Index: squid/src/wccp2.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/wccp2.c,v retrieving revision 1.26 retrieving revision 1.26.4.1 diff -u -r1.26 -r1.26.4.1 --- squid/src/wccp2.c 2 Dec 2006 22:51:49 -0000 1.26 +++ squid/src/wccp2.c 5 Dec 2006 13:45:50 -0000 1.26.4.1 @@ -1,6 +1,6 @@ /* - * $Id: wccp2.c,v 1.26 2006/12/02 22:51:49 squidadm Exp $ + * $Id: wccp2.c,v 1.26.4.1 2006/12/05 13:45:50 adri Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Steven WIlton @@ -1478,6 +1478,10 @@ value = 0; for (valuecounter = 0; valuecounter < 64; valuecounter++) { value_element = (struct wccp2_value_element_t *) &wccp_packet[offset]; + /* Update the value according the the "correct" formula */ + for (; (value & 0x1741) != value; value++) { + assert(value <= 0x1741); + } if ((service_flags & WCCP2_SERVICE_SRC_IP_HASH) || (service_flags & WCCP2_SERVICE_SRC_IP_ALT_HASH)) { value_element->source_ip_value = htonl(value); @@ -1504,11 +1508,8 @@ } value_element->cache_ip = cache_list_ptr->cache_ip; offset += sizeof(struct wccp2_value_element_t); + value++; - /* Update the value according the the "correct" formula */ - for (value++; (value & 0x1741) != value; value++) { - assert(value <= 0x1741); - } /* Assign the next value to the next cache */ if ((cache_list_ptr->next) && (cache_list_ptr->next->next))