Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174337408
D60210.id188336.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60210.id188336.diff
View Options
diff --git a/usr.sbin/tcpdrop/tcpdrop.c b/usr.sbin/tcpdrop/tcpdrop.c
--- a/usr.sbin/tcpdrop/tcpdrop.c
+++ b/usr.sbin/tcpdrop/tcpdrop.c
@@ -63,16 +63,16 @@
int
main(int argc, char *argv[])
{
- char stack[TCP_FUNCTION_NAME_LEN_MAX];
- char ca_name[TCP_CA_NAME_MAX];
- char *lport, *fport;
+ char stack_buf[TCP_FUNCTION_NAME_LEN_MAX];
+ char ca_name_buf[TCP_CA_NAME_MAX];
+ char *stack, *ca_name, *lport, *fport;
bool dropall, dropspecific;
int ch, state;
dropall = false;
dropspecific = false;
- ca_name[0] = '\0';
- stack[0] = '\0';
+ ca_name = NULL;
+ stack = NULL;
state = -1;
while ((ch = getopt(argc, argv, "aC:lS:s:")) != -1) {
@@ -82,14 +82,16 @@
break;
case 'C':
dropspecific = true;
- strlcpy(ca_name, optarg, sizeof(ca_name));
+ strlcpy(ca_name_buf, optarg, sizeof(ca_name_buf));
+ ca_name = ca_name_buf;
break;
case 'l':
tcpdrop_list_commands = true;
break;
case 'S':
dropspecific = true;
- strlcpy(stack, optarg, sizeof(stack));
+ strlcpy(stack_buf, optarg, sizeof(stack_buf));
+ stack = stack_buf;
break;
case 's':
dropspecific = true;
@@ -266,12 +268,12 @@
* If requested, skip sockets not having the requested
* congestion control algorithm.
*/
- if (ca_name[0] != '\0' &&
+ if (ca_name != NULL &&
strncmp(xtp->xt_cc, ca_name, TCP_CA_NAME_MAX))
continue;
/* If requested, skip sockets not having the requested stack. */
- if (stack[0] != '\0' &&
+ if (stack != NULL &&
strncmp(xtp->xt_stack, stack, TCP_FUNCTION_NAME_LEN_MAX))
continue;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 3, 12:27 PM (1 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40094310
Default Alt Text
D60210.id188336.diff (1 KB)
Attached To
Mode
D60210: tcpdrop: improve handling of -C and -S
Attached
Detach File
Event Timeline
Log In to Comment