Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 588020 Details for
Bug 813944
missing TCP_CONGESTION
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Added implementation of -C command line option
0001-Added-implementation-of-C-command-line-option.patch (text/plain), 2.87 KB, created by
Michal Sekletar
on 2012-05-31 09:46:00 UTC
(
hide
)
Description:
Added implementation of -C command line option
Filename:
MIME Type:
Creator:
Michal Sekletar
Created:
2012-05-31 09:46:00 UTC
Size:
2.87 KB
patch
obsolete
>From f510a379f0b680fe02d5a5fb90a8cf0204edbf77 Mon Sep 17 00:00:00 2001 >From: Michal Sekletar <msekleta@redhat.com> >Date: Thu, 31 May 2012 11:32:42 +0200 >Subject: [PATCH] Added implementation of -C command line option > >New command line option -C <algo> enables user to specify TCP congestion >control algorithm to use during the connection. In order to use selected >algorithm, appropriate kernel module must be loaded and algortithm must >be allowed. It is responsibility of user to do it. >--- > ttcp.c | 33 ++++++++++++++++++++++++++++++--- > 1 file changed, 30 insertions(+), 3 deletions(-) > >diff --git a/ttcp.c b/ttcp.c >index cf8e01a..9af0eaa 100644 >--- a/ttcp.c >+++ b/ttcp.c >@@ -123,6 +123,10 @@ char fmt = 'K'; /* output format: k = kilobits, K = kilobytes, > int touchdata = 0; /* access data after reading */ > static long wait = 0; /* usecs to wait between each write */ > int af = AF_UNSPEC; /* Address family to be determined */ >+#ifdef __linux__ >+int cong = 0; /* 0 = default congestion control, 1 = explicit congestion control */ >+char *cong_algorithm = NULL; /* congestion control algorithm to use */ >+#endif > > extern int errno; > extern int optind; >@@ -144,8 +148,11 @@ Common options:\n\ > -v verbose: print more statistics\n\ > -d set SO_DEBUG socket option\n\ > -b ## set socket buffer size (if supported)\n\ >- -f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga\n\ >-Options specific to -t:\n\ >+ -f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga\n" >+#ifdef __linux__ >+" -C ## Specify TCP congestion control algorithm to use\n" >+#endif >+"Options specific to -t:\n\ > -n ## number of source bufs written to network (default 2048)\n\ > -D don't buffer TCP writes (sets TCP_NODELAY socket option)\n\ > -w ## number of microseconds to wait between each write\n\ >@@ -182,10 +189,16 @@ main(int argc, char **argv) > char *device = NULL; > int maf = 0; /* Address family if multicast, else 0 */ > int c; >+ const char *opts = NULL; >+#ifdef __linux__ >+ opts = "46drstuvBDTb:f:l:n:p:w:A:O:I:C:"; >+#else >+ opts = "46drstuvBDTb:f:l:n:p:w:A:O:I:"; >+#endif > > if (argc < 2) goto usage; > >- while ((c = getopt(argc, argv, "46drstuvBDTb:f:l:n:p:w:A:O:I:")) != -1) { >+ while ((c = getopt(argc, argv, opts)) != -1) { > switch (c) { > case '4': > af = AF_INET; >@@ -257,6 +270,12 @@ main(int argc, char **argv) > case 'T': > touchdata = 1; > break; >+#ifdef __linux__ >+ case 'C': >+ cong = 1; >+ cong_algorithm = optarg; >+ break; >+#endif > default: > goto usage; > } >@@ -435,6 +454,14 @@ main(int argc, char **argv) > #endif > > if (!udp) { >+#ifdef __linux__ >+ /* set explicit congestion control algorithm */ >+ if (cong) { >+ if (setsockopt(fd, SOL_TCP, TCP_CONGESTION, cong_algorithm, strlen(cong_algorithm) + 1) < 0) { >+ err("setsockopt"); >+ } >+ } >+#endif > signal(SIGPIPE, sigpipe); > if (trans) { > /* We are the client if transmitting */ >-- >1.7.10.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
msekleta
: review?
Actions:
View
|
Diff
Attachments on
bug 813944
: 588020