FreeBSD Bugzilla – Attachment 174743 Details for
Bug 212669
change ipfw to all table all destroy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to add the feature
ipfw.diff (text/plain), 2.53 KB, created by
John Zielinski
on 2016-09-13 19:59:13 UTC
(
hide
)
Description:
patch to add the feature
Filename:
MIME Type:
Creator:
John Zielinski
Created:
2016-09-13 19:59:13 UTC
Size:
2.53 KB
patch
obsolete
>Index: sbin/ipfw/ipfw.8 >=================================================================== >--- sbin/ipfw/ipfw.8 (revision 305452) >+++ sbin/ipfw/ipfw.8 (working copy) >@@ -50,7 +50,9 @@ > .Nm > .Oo Cm set Ar N Oc Cm table Ar name Cm create Ar create-options > .Nm >-.Oo Cm set Ar N Oc Cm table Ar name Cm destroy >+.Oo Cm set Ar N Oc Cm table >+.Brq Ar name | all >+.Cm destroy > .Nm > .Oo Cm set Ar N Oc Cm table Ar name Cm modify Ar modify-options > .Nm >Index: sbin/ipfw/tables.c >=================================================================== >--- sbin/ipfw/tables.c (revision 305452) >+++ sbin/ipfw/tables.c (working copy) >@@ -57,6 +57,7 @@ > uint32_t set, uint16_t uidx); > > static int table_flush_one(ipfw_xtable_info *i, void *arg); >+static int table_destroy_one(ipfw_xtable_info *i, void *arg); > static int table_show_one(ipfw_xtable_info *i, void *arg); > static int table_do_get_list(ipfw_xtable_info *i, ipfw_obj_header **poh); > static void table_show_list(ipfw_obj_header *oh, int need_header); >@@ -134,7 +135,7 @@ > * This one handles all table-related commands > * ipfw table NAME create ... > * ipfw table NAME modify ... >- * ipfw table NAME destroy >+ * ipfw table (NAME | all) destroy > * ipfw table NAME swap NAME > * ipfw table NAME lock > * ipfw table NAME unlock >@@ -201,6 +202,7 @@ > case TOK_LIST: > case TOK_INFO: > case TOK_DETAIL: >+ case TOK_DESTROY: > case TOK_FLUSH: > break; > default: >@@ -225,13 +227,19 @@ > table_modify(&oh, ac, av); > break; > case TOK_DESTROY: >- if (table_destroy(&oh) == 0) >- break; >- if (errno != ESRCH) >- err(EX_OSERR, "failed to destroy table %s", tablename); >- /* ESRCH isn't fatal, warn if not quiet mode */ >- if (co.do_quiet == 0) >- warn("failed to destroy table %s", tablename); >+ if (is_all == 0) { >+ if (table_destroy(&oh) == 0) >+ break; >+ if (errno != ESRCH) >+ err(EX_OSERR, "failed to destroy table %s", tablename); >+ /* ESRCH isn't fatal, warn if not quiet mode */ >+ if (co.do_quiet == 0) >+ warn("failed to destroy table %s", tablename); >+ } else { >+ error = tables_foreach(table_destroy_one, &oh, 1); >+ if (error != 0) >+ err(EX_OSERR, "failed to destroy tables list"); >+ } > break; > case TOK_FLUSH: > if (is_all == 0) { >@@ -822,6 +830,18 @@ > } > > static int >+table_destroy_one(ipfw_xtable_info *i, void *arg) >+{ >+ ipfw_obj_header *oh; >+ >+ oh = (ipfw_obj_header *)arg; >+ >+ table_fill_ntlv(&oh->ntlv, i->tablename, i->set, 1); >+ >+ return (table_destroy(oh)); >+} >+ >+static int > table_do_modify_record(int cmd, ipfw_obj_header *oh, > ipfw_obj_tentry *tent, int count, int atomic) > {
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 212669
: 174743