mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 05:34:58 +02:00
xt_pknock: support for Linux 3.10
This commit is contained in:
@@ -190,8 +190,7 @@ status_itoa(enum status status)
|
|||||||
static void *
|
static void *
|
||||||
pknock_seq_start(struct seq_file *s, loff_t *pos)
|
pknock_seq_start(struct seq_file *s, loff_t *pos)
|
||||||
{
|
{
|
||||||
const struct proc_dir_entry *pde = s->private;
|
const struct xt_pknock_rule *rule = s->private;
|
||||||
const struct xt_pknock_rule *rule = pde->data;
|
|
||||||
|
|
||||||
spin_lock_bh(&list_lock);
|
spin_lock_bh(&list_lock);
|
||||||
|
|
||||||
@@ -210,8 +209,7 @@ pknock_seq_start(struct seq_file *s, loff_t *pos)
|
|||||||
static void *
|
static void *
|
||||||
pknock_seq_next(struct seq_file *s, void *v, loff_t *pos)
|
pknock_seq_next(struct seq_file *s, void *v, loff_t *pos)
|
||||||
{
|
{
|
||||||
const struct proc_dir_entry *pde = s->private;
|
const struct xt_pknock_rule *rule = s->private;
|
||||||
const struct xt_pknock_rule *rule = pde->data;
|
|
||||||
|
|
||||||
++*pos;
|
++*pos;
|
||||||
if (*pos >= peer_hashsize)
|
if (*pos >= peer_hashsize)
|
||||||
@@ -243,8 +241,7 @@ pknock_seq_show(struct seq_file *s, void *v)
|
|||||||
unsigned long time;
|
unsigned long time;
|
||||||
const struct list_head *peer_head = v;
|
const struct list_head *peer_head = v;
|
||||||
|
|
||||||
const struct proc_dir_entry *pde = s->private;
|
const struct xt_pknock_rule *rule = s->private;
|
||||||
const struct xt_pknock_rule *rule = pde->data;
|
|
||||||
|
|
||||||
list_for_each_safe(pos, n, peer_head) {
|
list_for_each_safe(pos, n, peer_head) {
|
||||||
peer = list_entry(pos, struct peer, head);
|
peer = list_entry(pos, struct peer, head);
|
||||||
@@ -295,7 +292,7 @@ pknock_proc_open(struct inode *inode, struct file *file)
|
|||||||
int ret = seq_open(file, &pknock_seq_ops);
|
int ret = seq_open(file, &pknock_seq_ops);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
struct seq_file *sf = file->private_data;
|
struct seq_file *sf = file->private_data;
|
||||||
sf->private = PDE(inode);
|
sf->private = PDE_DATA(inode);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -478,13 +475,11 @@ add_rule(struct xt_pknock_mtinfo *info)
|
|||||||
rule->timer.function = peer_gc;
|
rule->timer.function = peer_gc;
|
||||||
rule->timer.data = (unsigned long)rule;
|
rule->timer.data = (unsigned long)rule;
|
||||||
|
|
||||||
rule->status_proc = create_proc_entry(info->rule_name, 0, pde);
|
rule->status_proc = proc_create_data(info->rule_name, 0, pde,
|
||||||
|
&pknock_proc_ops, rule);
|
||||||
if (rule->status_proc == NULL)
|
if (rule->status_proc == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rule->status_proc->proc_fops = &pknock_proc_ops;
|
|
||||||
rule->status_proc->data = rule;
|
|
||||||
|
|
||||||
list_add(&rule->head, &rule_hashtable[hash]);
|
list_add(&rule->head, &rule_hashtable[hash]);
|
||||||
pr_debug("(A) rule_name: %s - created.\n", rule->rule_name);
|
pr_debug("(A) rule_name: %s - created.\n", rule->rule_name);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user