summaryrefslogtreecommitdiffstats
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2010-01-13 00:32:44 +0000
committerDavid Lamparter <equinox@diac24.net>2010-02-03 01:53:43 +0100
commit2442cdc3064f87860972ce6397fbaab52e200a00 (patch)
tree882d9c515a902619d858bb304aa3bca6e1bb359a /lib/sockunion.c
parentd8a0b61139fa64192269fd121bb6ccc90e16dfe2 (diff)
downloadquagga-2442cdc3064f87860972ce6397fbaab52e200a00.tar.bz2
quagga-2442cdc3064f87860972ce6397fbaab52e200a00.tar.xz
BGP: enable TCP corking
On BGP write, use TCP_CORK to provide hints to kernel about TCP buffering. This will cause BGP packets to occur in bigger chunks (full size MTU), improving performance and getting rid of one of the problems reported in the UNH BGP conformance test.
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 6a40f332..f6c060f5 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -527,6 +527,16 @@ sockopt_ttl (int family, int sock, int ttl)
return 0;
}
+int
+sockopt_cork (int sock, int onoff)
+{
+#ifdef TCP_CORK
+ return setsockopt (sock, IPPROTO_TCP, TCP_CORK, &onoff, sizeof(onoff));
+#else
+ return 0;
+#endif
+}
+
/* If same family and same prefix return 1. */
int
sockunion_same (union sockunion *su1, union sockunion *su2)