FreeBSD Bugzilla – Attachment 222815 Details for
Bug 233072
ipfw table 1 create type number: Table creation failed: Operation not supported
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
defalog.diff (text/plain), 1.10 KB, created by
Andrey V. Elsukov
on 2021-02-25 10:27:54 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Andrey V. Elsukov
Created:
2021-02-25 10:27:54 UTC
Size:
1.10 KB
patch
obsolete
>diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c >index 57b8cef00889..81cf7e392586 100644 >--- a/sbin/ipfw/tables.c >+++ b/sbin/ipfw/tables.c >@@ -83,6 +83,15 @@ static struct _s_x tabletypes[] = { > { NULL, 0 } > }; > >+/* Default algorithms for various table types */ >+static struct _s_x tablealgos[] = { >+ { "addr:radix", IPFW_TABLE_ADDR }, >+ { "flow:hash", IPFW_TABLE_FLOW }, >+ { "iface:array", IPFW_TABLE_INTERFACE }, >+ { "number:array", IPFW_TABLE_NUMBER }, >+ { NULL, 0 } >+}; >+ > static struct _s_x tablevaltypes[] = { > { "skipto", IPFW_VTYPE_SKIPTO }, > { "pipe", IPFW_VTYPE_PIPE }, >@@ -468,8 +477,15 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) > } > > /* Set some defaults to preserve compatibility. */ >- if (xi.algoname[0] == '\0' && xi.type == 0) >- xi.type = IPFW_TABLE_ADDR; >+ if (xi.algoname[0] == '\0') { >+ const char *algo; >+ >+ if (xi.type == 0) >+ xi.type = IPFW_TABLE_ADDR; >+ algo = match_value(tablealgos, xi.type); >+ if (algo != NULL) >+ strlcpy(xi.algoname, algo, sizeof(xi.algoname)); >+ } > if (xi.vmask == 0) > xi.vmask = IPFW_VTYPE_LEGACY; >
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 233072
: 222815