Handle the absence of IP_MTU_DISCOVER
This commit is contained in:
committed by
Keith Winstein
parent
e8d14d35a6
commit
a1671bcf3b
@@ -89,6 +89,11 @@ AC_CHECK_DECL([htobe64],
|
|||||||
[[#include <libkern/OSByteOrder.h>]])],
|
[[#include <libkern/OSByteOrder.h>]])],
|
||||||
[[#include <endian.h>]])
|
[[#include <endian.h>]])
|
||||||
|
|
||||||
|
AC_CHECK_DECL([IP_MTU_DISCOVER],
|
||||||
|
[AC_DEFINE([HAVE_IP_MTU_DISCOVER], [1],
|
||||||
|
[Define if IP_MTU_DISCOVER is a valid sockopt.])],
|
||||||
|
, [[#include <netinet/ip.h>]])
|
||||||
|
|
||||||
# Checks for protobuf
|
# Checks for protobuf
|
||||||
PKG_CHECK_MODULES([protobuf], [protobuf])
|
PKG_CHECK_MODULES([protobuf], [protobuf])
|
||||||
|
|
||||||
|
|||||||
@@ -106,11 +106,13 @@ void Connection::setup( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Disable path MTU discovery */
|
/* Disable path MTU discovery */
|
||||||
|
#ifdef HAVE_IP_MTU_DISCOVER
|
||||||
char flag = IP_PMTUDISC_DONT;
|
char flag = IP_PMTUDISC_DONT;
|
||||||
socklen_t optlen = sizeof( flag );
|
socklen_t optlen = sizeof( flag );
|
||||||
if ( setsockopt( sock, IPPROTO_IP, IP_MTU_DISCOVER, &flag, optlen ) < 0 ) {
|
if ( setsockopt( sock, IPPROTO_IP, IP_MTU_DISCOVER, &flag, optlen ) < 0 ) {
|
||||||
throw NetworkException( "setsockopt", errno );
|
throw NetworkException( "setsockopt", errno );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Connection::Connection( const char *desired_ip ) /* server */
|
Connection::Connection( const char *desired_ip ) /* server */
|
||||||
|
|||||||
Reference in New Issue
Block a user