aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-08-23 18:32:27 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 18:36:48 (GMT)
commitff066ec798bf7a1da5e5688cada8f1ff5de37d90 (patch)
treefe832d118bf41b7b9e9b76e044183a50df85257b /src
parent4506400e9f2ecf0f1ef4aa04963621de95f1cfec (diff)
downloadhostap-06-ff066ec798bf7a1da5e5688cada8f1ff5de37d90.zip
hostap-06-ff066ec798bf7a1da5e5688cada8f1ff5de37d90.tar.gz
hostap-06-ff066ec798bf7a1da5e5688cada8f1ff5de37d90.tar.bz2
Disable PMTU discovery for RADIUS packets (sent them without DF)
When Linux has Path MTU discovery enabled, it sets by default the DF bit on all outgoing datagrams, also UDP ones. If a RADIUS message is bigger than the smallest MTU size to the target, it will be discarded. This effectively limits RADIUS messages to ~ 1500 Bytes, while they can be up to 4k according to RFC2865. In practice, this can mean trouble when doing EAP-TLS with many RADIUS attributes besides the EAP-Message. [Bug 326] (cherry picked from commit 5cd89c26f952a6cd6fca4b55d52fe849e7483a62)
Diffstat (limited to 'src')
-rw-r--r--src/radius/radius_server.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
index cb4d7b1..1d37b17 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -769,6 +769,22 @@ fail:
}
+static int radius_server_disable_pmtu_discovery(int s)
+{
+ int r = -1;
+#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
+ /* Turn off Path MTU discovery on IPv4/UDP sockets. */
+ int action = IP_PMTUDISC_DONT;
+ r = setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &action,
+ sizeof(action));
+ if (r == -1)
+ wpa_printf(MSG_ERROR, "Failed to set IP_MTU_DISCOVER: "
+ "%s", strerror(errno));
+#endif
+ return r;
+}
+
+
static int radius_server_open_socket(int port)
{
int s;
@@ -780,6 +796,8 @@ static int radius_server_open_socket(int port)
return -1;
}
+ radius_server_disable_pmtu_discovery(s);
+
os_memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);