FreeBSD Bugzilla – Attachment 182222 Details for
Bug 218993
[patch] [ipfw] ipfw(8) may fail to remove rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
clean structures before reusing
ipfwdel.diff (text/plain), 1.21 KB, created by
Eugene Grosbein
on 2017-05-01 12:36:20 UTC
(
hide
)
Description:
clean structures before reusing
Filename:
MIME Type:
Creator:
Eugene Grosbein
Created:
2017-05-01 12:36:20 UTC
Size:
1.21 KB
patch
obsolete
>--- sbin/ipfw/ipfw2.c.orig 2017-04-10 20:47:20.140177000 +0700 >+++ sbin/ipfw/ipfw2.c 2017-05-01 19:23:29.097139000 +0700 >@@ -3176,7 +3176,6 @@ ipfw_delete(char *av[]) > > av++; > NEED1("missing rule specification"); >- memset(&rt, 0, sizeof(rt)); > if ( *av && _substrcmp(*av, "set") == 0) { > /* Do not allow using the following syntax: > * ipfw set N delete set M >@@ -3189,6 +3188,7 @@ ipfw_delete(char *av[]) > > /* Rule number */ > while (*av && isdigit(**av)) { >+ memset(&rt, 0, sizeof(rt)); > i = strtol(*av, &sep, 10); > j = i; > if (*sep== '-') >@@ -5124,12 +5124,11 @@ ipfw_zero(int ac, char *av[], int optnam > char const *name = optname ? "RESETLOG" : "ZERO"; > > optname = optname ? IP_FW_XRESETLOG : IP_FW_XZERO; >- memset(&rt, 0, sizeof(rt)); >- > av++; ac--; > > if (ac == 0) { > /* clear all entries */ >+ memset(&rt, 0, sizeof(rt)); > rt.flags = IPFW_RCFLAG_ALL; > if (do_range_cmd(optname, &rt) < 0) > err(EX_UNAVAILABLE, "setsockopt(IP_FW_X%s)", name); >@@ -5147,6 +5146,7 @@ ipfw_zero(int ac, char *av[], int optnam > if (errstr) > errx(EX_DATAERR, > "invalid rule number %s\n", *av); >+ memset(&rt, 0, sizeof(rt)); > rt.start_rule = arg; > rt.end_rule = arg; > rt.flags |= IPFW_RCFLAG_RANGE;
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
Actions:
View
|
Diff
Attachments on
bug 218993
: 182222