Page MenuHomeFreeBSD

D60210.diff
No OneTemporary

D60210.diff

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

Mime Type
text/plain
Expires
Sun, Oct 4, 4:48 AM (17 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40094310
Default Alt Text
D60210.diff (1 KB)

Event Timeline