OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 55... | Line 55... | |||
55 | + continue; |
55 | + continue; |
|
56 | + |
56 | + |
|
57 | if (nf_ct_is_expired(tmp)) { |
57 | if (nf_ct_is_expired(tmp)) { |
|
58 | nf_ct_gc_expired(tmp); |
58 | nf_ct_gc_expired(tmp); |
|
59 | continue; |
59 | continue; |
|
60 | @@ -978,6 +981,18 @@ static bool gc_worker_can_early_drop(con |
60 | @@ -975,6 +978,18 @@ static bool gc_worker_can_early_drop(con |
|
61 | return false; |
61 | return false; |
|
62 | } |
62 | } |
|
Line 63... | Line 63... | |||
63 | |
63 | |
|
64 | +#define DAY (86400 * HZ) |
64 | +#define DAY (86400 * HZ) |
|
Line 74... | Line 74... | |||
74 | +} |
74 | +} |
|
75 | + |
75 | + |
|
76 | static void gc_worker(struct work_struct *work) |
76 | static void gc_worker(struct work_struct *work) |
|
77 | { |
77 | { |
|
78 | unsigned int min_interval = max(HZ / GC_MAX_BUCKETS_DIV, 1u); |
78 | unsigned int min_interval = max(HZ / GC_MAX_BUCKETS_DIV, 1u); |
|
79 | @@ -1014,6 +1029,11 @@ static void gc_worker(struct work_struct |
79 | @@ -1011,6 +1026,11 @@ static void gc_worker(struct work_struct |
|
80 | tmp = nf_ct_tuplehash_to_ctrack(h); |
80 | tmp = nf_ct_tuplehash_to_ctrack(h); |
|
Line 81... | Line 81... | |||
81 | |
81 | |
|
82 | scanned++; |
82 | scanned++; |
|
83 | + if (test_bit(IPS_OFFLOAD_BIT, &tmp->status)) { |
83 | + if (test_bit(IPS_OFFLOAD_BIT, &tmp->status)) { |
|
Line 88... | Line 88... | |||
88 | if (nf_ct_is_expired(tmp)) { |
88 | if (nf_ct_is_expired(tmp)) { |
|
89 | nf_ct_gc_expired(tmp); |
89 | nf_ct_gc_expired(tmp); |
|
90 | expired_count++; |
90 | expired_count++; |
|
91 | --- a/net/netfilter/nf_conntrack_netlink.c |
91 | --- a/net/netfilter/nf_conntrack_netlink.c |
|
92 | +++ b/net/netfilter/nf_conntrack_netlink.c |
92 | +++ b/net/netfilter/nf_conntrack_netlink.c |
|
93 | @@ -1120,6 +1120,14 @@ static const struct nla_policy ct_nla_po |
93 | @@ -1105,6 +1105,14 @@ static const struct nla_policy ct_nla_po |
|
94 | .len = NF_CT_LABELS_MAX_SIZE }, |
94 | .len = NF_CT_LABELS_MAX_SIZE }, |
|
95 | }; |
95 | }; |
|
Line 96... | Line 96... | |||
96 | |
96 | |
|
97 | +static int ctnetlink_flush_iterate(struct nf_conn *ct, void *data) |
97 | +static int ctnetlink_flush_iterate(struct nf_conn *ct, void *data) |
|
Line 103... | Line 103... | |||
103 | +} |
103 | +} |
|
104 | + |
104 | + |
|
105 | static int ctnetlink_flush_conntrack(struct net *net, |
105 | static int ctnetlink_flush_conntrack(struct net *net, |
|
106 | const struct nlattr * const cda[], |
106 | const struct nlattr * const cda[], |
|
107 | u32 portid, int report) |
107 | u32 portid, int report) |
|
108 | @@ -1132,7 +1140,7 @@ static int ctnetlink_flush_conntrack(str |
108 | @@ -1117,7 +1125,7 @@ static int ctnetlink_flush_conntrack(str |
|
109 | return PTR_ERR(filter); |
109 | return PTR_ERR(filter); |
|
110 | } |
110 | } |
|
Line 111... | Line 111... | |||
111 | |
111 | |
|
112 | - nf_ct_iterate_cleanup_net(net, ctnetlink_filter_match, filter, |
112 | - nf_ct_iterate_cleanup_net(net, ctnetlink_filter_match, filter, |
|
113 | + nf_ct_iterate_cleanup_net(net, ctnetlink_flush_iterate, filter, |
113 | + nf_ct_iterate_cleanup_net(net, ctnetlink_flush_iterate, filter, |
|
114 | portid, report); |
114 | portid, report); |
|
Line 115... | Line 115... | |||
115 | kfree(filter); |
115 | kfree(filter); |
|
Line 116... | Line 116... | |||
116 | |
116 | |
|
Line 117... | Line 117... | |||
117 | @@ -1178,6 +1186,11 @@ static int ctnetlink_del_conntrack(struc |
117 | @@ -1163,6 +1171,11 @@ static int ctnetlink_del_conntrack(struc |
|
118 | |
118 | |