/* hwaddr_aton - Convert ASCII string to MAC address @txt: MAC address as a string (e.g., "00:11:22:33:44:55") @addr: Buffer for the MAC address (ETH_ALEN = 6 bytes) Returns: 0 on success, -1 on failure (e.g., string not a MAC address)  */
static int hwaddr_aton_i(const char *txt, u8 *addr)
/* hwaddr_aton - Convert ASCII string to MAC address @txt: MAC address as a string (e.g., "00:11:22:33:44:55") @addr: Buffer for the MAC address (ETH_ALEN = 6 bytes) Returns: 0 on success, -1 on failure (e.g., string not a MAC address)  */
static int hwaddr_aton_i(const char *txt, u8 *addr)
{
	int i;
	for (i = 0; i < 6; i++) {
		int a, b;
		a = hex2num_i(*txt++);
		if (a < 0)
			return -1;
		b = hex2num_i(*txt++);
		if (b < 0)
			return -1;
		*addr++ = (a << 4) | b;
		if (i < 5 && *txt++ != ':')
			return -1;
	}
	return 0;
}