mirror of
				https://github.com/rofl0r/proxychains-ng.git
				synced 2025-11-04 09:06:05 +00:00 
			
		
		
		
	gethostbyaddr hook: also set aliases.
i inspected behaviour of libc's and they all seem to set a valid h_aliases pointer, of which the first one should be NULL, if no aliases exist.
This commit is contained in:
		@@ -400,6 +400,7 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
 | 
			
		||||
	static char buf[16];
 | 
			
		||||
	static char ipv4[4];
 | 
			
		||||
	static char *list[2];
 | 
			
		||||
	static char *aliases[1];
 | 
			
		||||
	static struct hostent he;
 | 
			
		||||
 | 
			
		||||
	INIT();
 | 
			
		||||
@@ -419,7 +420,8 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
 | 
			
		||||
		list[1] = NULL;
 | 
			
		||||
		he.h_addr_list = list;
 | 
			
		||||
		he.h_addrtype = AF_INET;
 | 
			
		||||
		he.h_aliases = NULL;
 | 
			
		||||
		aliases[0] = NULL;
 | 
			
		||||
		he.h_aliases = aliases;
 | 
			
		||||
		he.h_length = 4;
 | 
			
		||||
		pc_stringfromipv4((unsigned char *) addr, buf);
 | 
			
		||||
		return &he;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user