[Asterisk-cvs] asterisk rtp.c,1.61,1.62

markster at lists.digium.com markster at lists.digium.com
Thu Apr 15 16:09:49 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv2290

Modified Files:
	rtp.c 
Log Message:
Don't set the address with NAT mode if we haven't programmed an address


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- rtp.c	22 Mar 2004 21:52:22 -0000	1.61
+++ rtp.c	15 Apr 2004 20:12:46 -0000	1.62
@@ -413,6 +413,12 @@
 		ast_log(LOG_WARNING, "RTP Read too short\n");
 		return &null_frame;
 	}
+
+	/* Ignore if the other side hasn't been given an address
+	   yet.  */
+	if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
+		return &null_frame;
+
 	if (rtp->nat) {
 		/* Send to whoever sent to us */
 		if ((rtp->them.sin_addr.s_addr != sin.sin_addr.s_addr) ||
@@ -421,10 +427,6 @@
 			ast_log(LOG_DEBUG, "RTP NAT: Using address %s:%d\n", inet_ntoa(rtp->them.sin_addr), ntohs(rtp->them.sin_port));
 		}
 	}
-	/* Ignore if the other side hasn't been given an address
-	   yet.  */
-	if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
-		return &null_frame;
 
 	/* Get fields */
 	seqno = ntohl(rtpheader[0]);




More information about the svn-commits mailing list