Skip to content

Instantly share code, notes, and snippets.

@h2onda
Last active August 26, 2015 06:41
Show Gist options
  • Save h2onda/4c29cc40dc827e297222 to your computer and use it in GitHub Desktop.
Save h2onda/4c29cc40dc827e297222 to your computer and use it in GitHub Desktop.
diff -up nc/netcat.c.deferaccept nc/netcat.c
--- nc/netcat.c.deferaccept 2015-08-12 10:39:57.408000840 +0900
+++ nc/netcat.c 2015-08-12 10:39:24.071001056 +0900
@@ -917,6 +917,11 @@ set_common_sockopts(int s)
&Tflag, sizeof(Tflag)) == -1)
err(1, "set IP ToS");
}
+ if (!uflag) {
+ if (setsockopt(s, IPPROTO_TCP, TCP_DEFER_ACCEPT,
+ &x, sizeof(x)) == -1)
+ err(1, NULL);
+ }
}
int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment