From 4c9b1270ca67b12326a3e37ae263dc8d8ac287ea Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 4 Apr 2008 17:39:38 +0000 Subject: [PATCH] Fri Apr 4 11:15:04 EDT 2008 Pekka.Pessi@nokia.com * tport_type_udp.c: use IP_MTU_DISCOVER socket option to turn off DF flag Added check for IP_MTU_DISCOVER in m4/sac-su2.m4 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8022 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c | 11 +++++++++++ libs/sofia-sip/m4/sac-su2.m4 | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index f0fd66e73e..cd699922b8 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Thu Apr 3 18:33:26 EDT 2008 +Fri Apr 4 13:39:32 EDT 2008 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c index 9b52abae1c..1ddce3e0df 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c @@ -162,6 +162,17 @@ int tport_udp_init_primary(tport_primary_t *pri, } #endif +#if HAVE_IP_MTU_DISCOVER + { + /* Turn off DF flag on Linux */ + int dont = IP_PMTUDISC_DONT; + if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &dont, sizeof(dont)) < 0) { + SU_DEBUG_3(("setsockopt(%s): %s\n", + "IP_MTU_DISCOVER", su_strerror(su_errno()))); + } + } +#endif + #if HAVE_IP_RECVERR if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) { if (setsockopt(s, IPPROTO_IP, IP_RECVERR, &one, sizeof(one)) < 0) { diff --git a/libs/sofia-sip/m4/sac-su2.m4 b/libs/sofia-sip/m4/sac-su2.m4 index ef33ab2355..8927ca1428 100644 --- a/libs/sofia-sip/m4/sac-su2.m4 +++ b/libs/sofia-sip/m4/sac-su2.m4 @@ -317,6 +317,13 @@ AC_DEFINE([HAVE_IP_MULTICAST_LOOP],1,[Define to 1 if you have IP_MULTICAST_LOOP] #include #include ]) +AC_CHECK_DECL([IP_MTU_DISCOVER], +AC_DEFINE([HAVE_IP_MTU_DISCOVER],1, +[Define to 1 if you have IP_MTU_DISCOVER]),,[ +#include +#include +#include ]) + AC_CACHE_CHECK([for struct addrinfo], [ac_cv_struct_addrinfo],[ ac_cv_struct_addrinfo=no