[polypaudio-commits] r725 - /trunk/src/modules/rtp/module-rtp-monitor.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Apr 16 03:53:30 PDT 2006


Author: lennart
Date: Sun Apr 16 12:53:27 2006
New Revision: 725

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=725&root=polypaudio&view=rev
Log:
* make sure RTP ports are chosen to be even

Modified:
    trunk/src/modules/rtp/module-rtp-monitor.c

Modified: trunk/src/modules/rtp/module-rtp-monitor.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/module-rtp-monitor.c?rev=725&root=polypaudio&r1=724&r2=725&view=diff
==============================================================================
--- trunk/src/modules/rtp/module-rtp-monitor.c (original)
+++ trunk/src/modules/rtp/module-rtp-monitor.c Sun Apr 16 12:53:27 2006
@@ -208,11 +208,14 @@
         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) {
         pa_log(__FILE__": port= expects a numerical argument between 1 and 65535.");
         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);
 




More information about the pulseaudio-commits mailing list