mirror of
				https://github.com/open5gs/open5gs.git
				synced 2025-11-04 05:53:18 +00:00 
			
		
		
		
	[CORE] Improve SO_BINDTODEVICE error log line (#1436)
This commit is contained in:
		@@ -184,9 +184,11 @@ int ogs_bind_to_device(ogs_socket_t fd, const char *device)
 | 
			
		||||
    ogs_debug("SO_BINDTODEVICE:[%s]", device);
 | 
			
		||||
    rc = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device)+1);
 | 
			
		||||
    if (rc != OGS_OK) {
 | 
			
		||||
        int err = errno;
 | 
			
		||||
        ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
 | 
			
		||||
                "setsockopt(SOL_SOCKET, SO_BINDTODEVICE, %s) failed", device);
 | 
			
		||||
        ogs_error("You need to grant privileges to use SO_BINDTODEVICE.");
 | 
			
		||||
        if (err == EPERM)
 | 
			
		||||
            ogs_error("You need to grant CAP_NET_RAW privileges to use SO_BINDTODEVICE.");
 | 
			
		||||
        return OGS_ERROR;
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user