617}
618EXPORT_SYMBOL(xt_free_table_info);
619
620
621struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
622 const char *name)
623{
624 struct xt_table *t;
625
626 if (mutex_lock_interruptible(&xt[af].mutex) != 0)
627 return ERR_PTR(-EINTR);
628
629 list_for_each_entry(t, &net->xt.tables[af], list)
630 if (strcmp(t->name, name) == 0 && try_module_get(t->me))
631 return t;
632 mutex_unlock(&xt[af].mutex);
633 return NULL;
634}
635EXPORT_SYMBOL_GPL(xt_find_table_lock);
636
637void xt_table_unlock(struct xt_table *table)
638{
639 mutex_unlock(&xt[table->af].mutex);
640}
641EXPORT_SYMBOL_GPL(xt_table_unlock);
642
643#ifdef CONFIG_COMPAT
644void xt_compat_lock(u_int8_t af)
645{
646 mutex_lock(&xt[af].compat_mutex);
647}
648EXPORT_SYMBOL_GPL(xt_compat_lock);
649
650void xt_compat_unlock(u_int8_t af)
651{
652 mutex_unlock(&xt[af].compat_mutex);
653}
654EXPORT_SYMBOL_GPL(xt_compat_unlock);
655#endif
656
657struct xt_table_info *