aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-05 18:58:13 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:17 +0800
commit9e938c680f0f46b92692ad787dcc355768f0b2e9 (patch)
treea5a3acbf7e8a7e7aea3e07d001aa80ae4725eef7 /openbsc/src/nat/bsc_nat.c
parent74cfab7b5d41ad3b3fac2539fe2cecb671293db9 (diff)
nat: Use TCP_NODELAY for the connection to the BSC.
We do not want to use NAGLE for the BSC connection.
Diffstat (limited to 'openbsc/src/nat/bsc_nat.c')
-rw-r--r--openbsc/src/nat/bsc_nat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index f69d38310..b9a158424 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -23,6 +23,7 @@
*/
#include <sys/socket.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <errno.h>
@@ -716,7 +717,7 @@ static int ipaccess_bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg)
static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what)
{
struct bsc_connection *bsc;
- int ret;
+ int ret, on;
struct sockaddr_in sa;
socklen_t sa_len = sizeof(sa);
@@ -741,6 +742,11 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what)
return 0;
}
+ on = 1;
+ ret = setsockopt(bfd->fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ if (ret != 0)
+ LOGP(DNAT, LOGL_ERROR, "Failed to set TCP_NODELAY: %s\n", strerror(errno));
+
/* todo... do something with the connection */
/* todo... use GNUtls to see if we want to trust this as a BTS */