I am injecting a dll in to a process to hook the winsock function connect, i am using microsoft detours 2.1 and this is just a research project

here is the hooked send function, what i want todo is change the ip to where connect is connecting to , does anyone know how todo it?
int WINAPI Mine_Connect(SOCKET Socket,const struct sockaddr *name,int namelen)
	static char IP[16];
	sprintf(IP,"%d.%d.%d.%d",(BYTE)name->sa_data[2], (BYTE)name->sa_data[3], (BYTE)name->sa_data[4], (BYTE)name->sa_data[5]);

	return Real_Connect(Socket,name,namelen);