diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2010-08-05 10:26:24 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2011-03-21 17:30:52 +0000 |
commit | 58192df7746231fbc82e248b5ddfc7cab95ab1e7 (patch) | |
tree | 15184e9fadcad65385fda94ae9f397bdc6e53b76 /lib/sockunion.c | |
parent | 35398589cf1293956dfefb5096aa5284c72a696f (diff) | |
download | quagga-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.c | 10 |
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) |