aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/udptl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/main/udptl.c b/main/udptl.c
index 3079da223..1e24e99a9 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -742,28 +742,32 @@ static void calculate_local_max_datagram(struct ast_udptl *udptl)
static void calculate_far_max_ifp(struct ast_udptl *udptl)
{
- unsigned new_max = 40;
+ unsigned new_max = 60;
/* calculate the maximum IFP the local endpoint should
* generate based on the far end's maximum datagram size
- * and the current error correction mode
+ * and the current error correction mode. some endpoints
+ * bogus 'max datagram' values that would result in unusable
+ * (too small) maximum IFP values, so we have a a reasonable
+ * minimum value to ensure that we can actually construct
+ * UDPTL packets.
*/
switch (udptl->error_correction_scheme) {
case UDPTL_ERROR_CORRECTION_NONE:
/* only need room for sequence number and length indicators */
- new_max = udptl->far_max_datagram - 6;
+ new_max = MAX(new_max, udptl->far_max_datagram - 6);
break;
case UDPTL_ERROR_CORRECTION_REDUNDANCY:
/* need room for sequence number, length indicators and the
* configured number of redundant packets
*/
- new_max = (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1);
+ new_max = MAX(new_max, (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1));
break;
case UDPTL_ERROR_CORRECTION_FEC:
/* need room for sequence number, length indicators and a
* a single IFP of the maximum size expected
*/
- new_max = (udptl->far_max_datagram - 10) / 2;
+ new_max = MAX(new_max, (udptl->far_max_datagram - 10) / 2);
break;
}
/* subtract 25% of space for insurance */