From ebd57da87d6499506aabf65b76d43904490b9eaa Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 5 May 2010 18:58:13 +0800 Subject: nat: Use TCP_NODELAY for the connection to the BSC. We do not want to use NAGLE for the BSC connection. --- openbsc/src/nat/bsc_nat.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'openbsc/src') diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 9fe444ce0..6b0baf7e1 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -23,6 +23,7 @@ */ #include #include +#include #include #include @@ -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 */ -- cgit v1.2.3