Révision e18deb1f
Ajouté par Ermal il y a presque 10 ans
patches/stable/10/CP_speedup.diff | ||
---|---|---|
761 | 761 |
{ |
762 | 762 |
ipfw_xtable *tbl; |
763 | 763 |
diff --git a/sys/netpfil/ipfw/ip_fw_table.c b/sys/netpfil/ipfw/ip_fw_table.c |
764 |
index 95cff5c..c7b6718 100644
|
|
764 |
index 95cff5c..971d257 100644
|
|
765 | 765 |
--- a/sys/netpfil/ipfw/ip_fw_table.c |
766 | 766 |
+++ b/sys/netpfil/ipfw/ip_fw_table.c |
767 | 767 |
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); |
... | ... | |
992 | 992 |
default: |
993 | 993 |
return (EINVAL); |
994 | 994 |
} |
995 |
@@ -552,9 +688,153 @@ ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
|
|
995 |
@@ -552,9 +688,157 @@ ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
|
|
996 | 996 |
return (0); |
997 | 997 |
} |
998 | 998 |
|
... | ... | |
1006 | 1006 |
+ xent->timestamp = time_uptime; |
1007 | 1007 |
+} |
1008 | 1008 |
+ |
1009 |
int
|
|
1009 |
+int
|
|
1010 | 1010 |
+ipfw_zero_table_xentry_stats(struct ip_fw_chain *ch, ipfw_table_xentry *arg) |
1011 | 1011 |
+{ |
1012 | 1012 |
+ struct radix_node_head *rnh; |
... | ... | |
1068 | 1068 |
+ return (0); |
1069 | 1069 |
+} |
1070 | 1070 |
+ |
1071 |
+int
|
|
1071 |
int
|
|
1072 | 1072 |
+ipfw_lookup_table_xentry(struct ip_fw_chain *ch, ipfw_table_xentry *arg) |
1073 | 1073 |
+{ |
1074 | 1074 |
+ struct radix_node_head *rnh; |
... | ... | |
1076 | 1076 |
+ |
1077 | 1077 |
+ if (arg->tbl >= V_fw_tables_max) |
1078 | 1078 |
+ return (0); |
1079 |
+ if ((rnh = ch->xtables[arg->tbl]) == NULL) |
|
1079 |
+ if (ch->tables[arg->tbl] != NULL) |
|
1080 |
+ rnh = ch->tables[arg->tbl]; |
|
1081 |
+ else if (ch->xtables[arg->tbl] != NULL) |
|
1082 |
+ rnh = ch->xtables[arg->tbl]; |
|
1083 |
+ else |
|
1080 | 1084 |
+ return (0); |
1081 | 1085 |
+ |
1082 | 1086 |
+ switch (arg->type) { |
... | ... | |
1147 | 1151 |
{ |
1148 | 1152 |
struct radix_node_head *rnh; |
1149 | 1153 |
struct table_xentry *xent; |
1150 |
@@ -562,15 +842,21 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1154 |
@@ -562,15 +846,21 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1151 | 1155 |
struct xaddr_iface iface; |
1152 | 1156 |
|
1153 | 1157 |
if (tbl >= V_fw_tables_max) |
... | ... | |
1171 | 1175 |
break; |
1172 | 1176 |
|
1173 | 1177 |
case IPFW_TABLE_INTERFACE: |
1174 |
@@ -581,15 +867,37 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1178 |
@@ -581,15 +871,37 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1175 | 1179 |
xent = (struct table_xentry *)(rnh->rnh_lookup(&iface, NULL, rnh)); |
1176 | 1180 |
break; |
1177 | 1181 |
|
... | ... | |
1212 | 1216 |
} |
1213 | 1217 |
|
1214 | 1218 |
static int |
1215 |
@@ -697,7 +1005,12 @@ dump_table_xentry_base(struct radix_node *rn, void *arg)
|
|
1219 |
@@ -697,7 +1009,12 @@ dump_table_xentry_base(struct radix_node *rn, void *arg)
|
|
1216 | 1220 |
xent->masklen = 33 - ffs(ntohl(n->mask.sin_addr.s_addr)); |
1217 | 1221 |
/* Save IPv4 address as deprecated IPv6 compatible */ |
1218 | 1222 |
xent->k.addr6.s6_addr32[3] = n->addr.sin_addr.s_addr; |
... | ... | |
1225 | 1229 |
tbl->cnt++; |
1226 | 1230 |
return (0); |
1227 | 1231 |
} |
1228 |
@@ -735,12 +1048,31 @@ dump_table_xentry_extended(struct radix_node *rn, void *arg)
|
|
1232 |
@@ -735,12 +1052,31 @@ dump_table_xentry_extended(struct radix_node *rn, void *arg)
|
|
1229 | 1233 |
memcpy(&xent->k, &n->a.iface.ifname, IF_NAMESIZE); |
1230 | 1234 |
break; |
1231 | 1235 |
|
Formats disponibles : Unified diff
Properly list table entry stats