aboutsummaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-12 18:31:26 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-12 18:31:26 +0000
commitb8e500649197199ddefffb2b93dc875a7f1934df (patch)
tree46586ceeff7c93a40e6160e95a9064297cee7408 /utils.c
parent54b6e50502ff33fd6c68d2ae03b2af0f5eedaa9e (diff)
ensure that IAX2 and SIP sockets allow UDP fragmentation when running on Linux (thanks to Brian Candler on the asterisk-dev list for the tip)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@44955 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 2e99ad17d..8f3dbcd7b 100644
--- a/utils.c
+++ b/utils.c
@@ -895,3 +895,14 @@ char *ast_process_quotes_and_slashes(char *start, char find, char replace_with)
*dataPut = 0;
return dataPut;
}
+
+void ast_enable_packet_fragmentation(int sock)
+{
+#ifdef __linux__
+ int val = IP_PMTUDISC_DONT;
+
+ if (setsockopt(sock, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val)))
+ ast_log(LOG_WARNING, "Unable to disable PMTU discovery. Large UDP packets may fail to be delivered when sent from this socket.\n");
+#endif
+}
+