summaryrefslogtreecommitdiffstats
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2010-08-05 10:26:24 -0700
committerPaul Jakma <paul@quagga.net>2011-03-21 17:30:52 +0000
commit58192df7746231fbc82e248b5ddfc7cab95ab1e7 (patch)
tree15184e9fadcad65385fda94ae9f397bdc6e53b76 /lib/sockunion.c
parent35398589cf1293956dfefb5096aa5284c72a696f (diff)
downloadquagga-58192df7746231fbc82e248b5ddfc7cab95ab1e7.tar.bz2
quagga-58192df7746231fbc82e248b5ddfc7cab95ab1e7.tar.xz
lib: add TCP_CORK wrapper
* sockunion.{c,h}: (sockopt_cork) wrapper for TCP_CORK socket option for those platforms that provide it. For other platforms, it is just a nop.
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)