Révision 9c57c4fc
Ajouté par Ermal il y a presque 10 ans
patches/stable/10/CP_speedup.diff | ||
---|---|---|
709 | 709 |
{ |
710 | 710 |
ipfw_xtable *tbl; |
711 | 711 |
diff --git a/sys/netpfil/ipfw/ip_fw_table.c b/sys/netpfil/ipfw/ip_fw_table.c |
712 |
index 95cff5c..7b8b961 100644
|
|
712 |
index 95cff5c..fd591f6 100644
|
|
713 | 713 |
--- a/sys/netpfil/ipfw/ip_fw_table.c |
714 | 714 |
+++ b/sys/netpfil/ipfw/ip_fw_table.c |
715 | 715 |
@@ -74,7 +74,11 @@ static MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables"); |
... | ... | |
870 | 870 |
default: |
871 | 871 |
return (EINVAL); |
872 | 872 |
} |
873 |
@@ -281,6 +368,18 @@ ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
873 |
@@ -281,6 +368,19 @@ ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
874 | 874 |
IPFW_WUNLOCK(ch); |
875 | 875 |
|
876 | 876 |
if (rn == NULL) { |
... | ... | |
885 | 885 |
+ ent2->value = value; |
886 | 886 |
+ } else |
887 | 887 |
+ ent2->value = value; |
888 |
+ } |
|
888 | 889 |
+ } |
889 | 890 |
free(ent_ptr, M_IPFW_TBL); |
890 | 891 |
return (EEXIST); |
891 | 892 |
} |
892 |
@@ -367,6 +466,41 @@ ipfw_del_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
893 |
@@ -367,6 +467,41 @@ ipfw_del_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
893 | 894 |
|
894 | 895 |
break; |
895 | 896 |
|
... | ... | |
931 | 932 |
default: |
932 | 933 |
return (EINVAL); |
933 | 934 |
} |
934 |
@@ -552,9 +686,152 @@ ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
|
|
935 |
@@ -552,9 +687,152 @@ ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
|
|
935 | 936 |
return (0); |
936 | 937 |
} |
937 | 938 |
|
... | ... | |
945 | 946 |
+ xent->timestamp = time_uptime; |
946 | 947 |
+} |
947 | 948 |
+ |
948 |
+int
|
|
949 |
int
|
|
949 | 950 |
+ipfw_zero_table_xentry_stats(struct ip_fw_chain *ch, ipfw_table_xentry *arg) |
950 | 951 |
+{ |
951 | 952 |
+ struct radix_node_head *rnh; |
... | ... | |
1007 | 1008 |
+ return (0); |
1008 | 1009 |
+} |
1009 | 1010 |
+ |
1010 |
int
|
|
1011 |
+int
|
|
1011 | 1012 |
+ipfw_lookup_table_xentry(struct ip_fw_chain *ch, ipfw_table_xentry *arg) |
1012 | 1013 |
+{ |
1013 | 1014 |
+ struct radix_node_head *rnh; |
... | ... | |
1085 | 1086 |
{ |
1086 | 1087 |
struct radix_node_head *rnh; |
1087 | 1088 |
struct table_xentry *xent; |
1088 |
@@ -562,15 +839,21 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1089 |
@@ -562,15 +840,21 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1089 | 1090 |
struct xaddr_iface iface; |
1090 | 1091 |
|
1091 | 1092 |
if (tbl >= V_fw_tables_max) |
... | ... | |
1109 | 1110 |
break; |
1110 | 1111 |
|
1111 | 1112 |
case IPFW_TABLE_INTERFACE: |
1112 |
@@ -581,15 +864,37 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1113 |
@@ -581,15 +865,37 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
|
|
1113 | 1114 |
xent = (struct table_xentry *)(rnh->rnh_lookup(&iface, NULL, rnh)); |
1114 | 1115 |
break; |
1115 | 1116 |
|
... | ... | |
1150 | 1151 |
} |
1151 | 1152 |
|
1152 | 1153 |
static int |
1153 |
@@ -698,6 +1003,9 @@ dump_table_xentry_base(struct radix_node *rn, void *arg)
|
|
1154 |
@@ -698,6 +1004,9 @@ dump_table_xentry_base(struct radix_node *rn, void *arg)
|
|
1154 | 1155 |
/* Save IPv4 address as deprecated IPv6 compatible */ |
1155 | 1156 |
xent->k.addr6.s6_addr32[3] = n->addr.sin_addr.s_addr; |
1156 | 1157 |
xent->value = n->value; |
... | ... | |
1160 | 1161 |
tbl->cnt++; |
1161 | 1162 |
return (0); |
1162 | 1163 |
} |
1163 |
@@ -735,12 +1043,31 @@ dump_table_xentry_extended(struct radix_node *rn, void *arg)
|
|
1164 |
@@ -735,12 +1044,31 @@ dump_table_xentry_extended(struct radix_node *rn, void *arg)
|
|
1164 | 1165 |
memcpy(&xent->k, &n->a.iface.ifname, IF_NAMESIZE); |
1165 | 1166 |
break; |
1166 | 1167 |
|
Formats disponibles : Unified diff
Another syntax error