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: https://origsvn.digium.com/svn/asterisk/branches/1.2@44955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-10-12 18:31:26 +00:00
parent 722d56e081
commit ffb75188e1
4 changed files with 31 additions and 0 deletions

11
utils.c
View File

@@ -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
}