diff options
| author | 2011-01-07 17:50:42 +0000 | |
|---|---|---|
| committer | 2011-01-07 17:50:42 +0000 | |
| commit | 3e816f04bbb5bf8411c3134b7593ef330bd6c5c2 (patch) | |
| tree | 051f70b2a5c520ad8072475c56a1d666bb18eb0c /sys/netinet/tcp_output.c | |
| parent | - Update Test::Simple to 0.96 (diff) | |
| download | wireguard-openbsd-3e816f04bbb5bf8411c3134b7593ef330bd6c5c2.tar.xz wireguard-openbsd-3e816f04bbb5bf8411c3134b7593ef330bd6c5c2.zip | |
Add socket option SO_SPLICE to splice together two TCP sockets.
The data received on the source socket will automatically be sent
on the drain socket. This allows to write relay daemons with zero
data copy.
ok markus@
Diffstat (limited to 'sys/netinet/tcp_output.c')
| -rw-r--r-- | sys/netinet/tcp_output.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 08d93835a4a..868b14c65e1 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_output.c,v 1.92 2010/09/24 02:59:45 claudio Exp $ */ +/* $OpenBSD: tcp_output.c,v 1.93 2011/01/07 17:50:42 bluhm Exp $ */ /* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */ /* @@ -228,6 +228,12 @@ tcp_output(struct tcpcb *tp) int needect; #endif + if (tp->t_flags & TF_BLOCKOUTPUT) { + tp->t_flags |= TF_NEEDOUTPUT; + return (0); + } else + tp->t_flags &= ~TF_NEEDOUTPUT; + #if defined(TCP_SACK) && defined(TCP_SIGNATURE) && defined(DIAGNOSTIC) if (tp->sack_enable && (tp->t_flags & TF_SIGNATURE)) return (EINVAL); |
