[Serdev] lcr bug that can be fixed in: mysql/val.c

Christopher Crawford crawford_c at pannaway.com
Tue Mar 22 01:03:54 UTC 2005


When using the lcr module, and routing to a gateway with the last IP tuple is greater than 127, it was found that the module was miscalculating the IP address when the value was retrieved from the database.  We switched the atoi call in mysql/str2int/val.c to atoll and the problem was fixed.  Below is the proposed fix:


/*
 * Convert a string to 'integer'
 */
static inline int str2int(const char* _s, int* _v)
{
	if ((!_s) || (!_v)) {
		LOG(L_ERR, "str2int(): Invalid parameter value\n");
		return -1;
	}

	*_v = atoll(_s);             <------------ fix here

	return 0;
}



Regards,

Chris




More information about the Serdev mailing list