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

View File

@@ -12856,10 +12856,13 @@ static int reload_config(void)
} else {
/* Allow SIP clients on the same host to access us: */
const int reuseFlag = 1;
setsockopt(sipsock, SOL_SOCKET, SO_REUSEADDR,
(const char*)&reuseFlag,
sizeof reuseFlag);
ast_enable_packet_fragmentation(sipsock);
if (bind(sipsock, (struct sockaddr *)&bindaddr, sizeof(bindaddr)) < 0) {
ast_log(LOG_WARNING, "Failed to bind to %s:%d: %s\n",
ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr), ntohs(bindaddr.sin_port),