diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-12 18:31:26 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-12 18:31:26 +0000 |
commit | b8e500649197199ddefffb2b93dc875a7f1934df (patch) | |
tree | 46586ceeff7c93a40e6160e95a9064297cee7408 /utils.c | |
parent | 54b6e50502ff33fd6c68d2ae03b2af0f5eedaa9e (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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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 +} + |