mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	* make sure RTP ports are chosen to be even
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@725 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									e75cc68685
								
							
						
					
					
						commit
						3b803e7168
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -208,12 +208,15 @@ int pa__init(pa_core *c, pa_module*m) {
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    port = DEFAULT_PORT + (rand() % 512);
 | 
					    port = DEFAULT_PORT + ((rand() % 512) << 1);
 | 
				
			||||||
    if (pa_modargs_get_value_u32(ma, "port", &port) < 0 || port < 1 || port > 0xFFFF) {
 | 
					    if (pa_modargs_get_value_u32(ma, "port", &port) < 0 || port < 1 || port > 0xFFFF) {
 | 
				
			||||||
        pa_log(__FILE__": port= expects a numerical argument between 1 and 65535.");
 | 
					        pa_log(__FILE__": port= expects a numerical argument between 1 and 65535.");
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (port & 1)
 | 
				
			||||||
 | 
					        pa_log_warn(__FILE__": WARNING: port number not even as suggested in RFC3550!");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    dest = pa_modargs_get_value(ma, "destination", DEFAULT_DESTINATION);
 | 
					    dest = pa_modargs_get_value(ma, "destination", DEFAULT_DESTINATION);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (inet_pton(AF_INET6, dest, &sa6.sin6_addr) > 0) {
 | 
					    if (inet_pton(AF_INET6, dest, &sa6.sin6_addr) > 0) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue