sock: log each result of getaddrinfo() in listen_sock()
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit a7898a2c98)
			
			
This commit is contained in:
		
							parent
							
								
									5608382be9
								
							
						
					
					
						commit
						37ffa6986d
					
				
							
								
								
									
										14
									
								
								src/sock.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/sock.c
									
									
									
									
									
								
							@ -193,6 +193,20 @@ int listen_sock (const char *addr, uint16_t port, vector_t listen_fds)
 | 
				
			|||||||
        for (rp = result; rp != NULL; rp = rp->ai_next) {
 | 
					        for (rp = result; rp != NULL; rp = rp->ai_next) {
 | 
				
			||||||
                int listenfd;
 | 
					                int listenfd;
 | 
				
			||||||
                int lret;
 | 
					                int lret;
 | 
				
			||||||
 | 
					                char numerichost[NI_MAXHOST];
 | 
				
			||||||
 | 
					                int flags = NI_NUMERICHOST;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                ret = getnameinfo(rp->ai_addr, rp->ai_addrlen,
 | 
				
			||||||
 | 
					                                  numerichost, NI_MAXHOST, NULL, 0, flags);
 | 
				
			||||||
 | 
					                if (ret != 0) {
 | 
				
			||||||
 | 
					                        log_message(LOG_ERR, "error calling getnameinfo: %s",
 | 
				
			||||||
 | 
					                                    gai_strerror(errno));
 | 
				
			||||||
 | 
					                       continue;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                log_message(LOG_INFO, "trying host[%s], family[%d], "
 | 
				
			||||||
 | 
					                            "socktype[%d], proto[%d]", numerichost,
 | 
				
			||||||
 | 
					                            rp->ai_family, rp->ai_socktype, rp->ai_protocol);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                listenfd = socket (rp->ai_family, rp->ai_socktype,
 | 
					                listenfd = socket (rp->ai_family, rp->ai_socktype,
 | 
				
			||||||
                                   rp->ai_protocol);
 | 
					                                   rp->ai_protocol);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user