Skip to content

Commit 66bff35

Browse files
Jan Engelhardtkaber
authored andcommitted
netfilter: remove unused Ebtables functions
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
1 parent 5365f80 commit 66bff35

2 files changed

Lines changed: 0 additions & 114 deletions

File tree

‎include/linux/netfilter_bridge/ebtables.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,6 @@ struct ebt_table
302302
~(__alignof__(struct ebt_replace)-1))
303303
extern int ebt_register_table(struct ebt_table *table);
304304
extern void ebt_unregister_table(struct ebt_table *table);
305-
extern int ebt_register_match(struct ebt_match *match);
306-
extern void ebt_unregister_match(struct ebt_match *match);
307-
extern int ebt_register_watcher(struct ebt_watcher *watcher);
308-
extern void ebt_unregister_watcher(struct ebt_watcher *watcher);
309-
extern int ebt_register_target(struct ebt_target *target);
310-
extern void ebt_unregister_target(struct ebt_target *target);
311305
extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
312306
const struct net_device *in, const struct net_device *out,
313307
struct ebt_table *table);

‎net/bridge/netfilter/ebtables.c‎

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@
5656

5757
static DEFINE_MUTEX(ebt_mutex);
5858
static LIST_HEAD(ebt_tables);
59-
static LIST_HEAD(ebt_targets);
60-
static LIST_HEAD(ebt_matches);
61-
static LIST_HEAD(ebt_watchers);
6259

6360
static struct xt_target ebt_standard_target = {
6461
.name = "standard",
@@ -322,24 +319,6 @@ find_table_lock(const char *name, int *error, struct mutex *mutex)
322319
return find_inlist_lock(&ebt_tables, name, "ebtable_", error, mutex);
323320
}
324321

325-
static inline struct ebt_match *
326-
find_match_lock(const char *name, int *error, struct mutex *mutex)
327-
{
328-
return find_inlist_lock(&ebt_matches, name, "ebt_", error, mutex);
329-
}
330-
331-
static inline struct ebt_watcher *
332-
find_watcher_lock(const char *name, int *error, struct mutex *mutex)
333-
{
334-
return find_inlist_lock(&ebt_watchers, name, "ebt_", error, mutex);
335-
}
336-
337-
static inline struct ebt_target *
338-
find_target_lock(const char *name, int *error, struct mutex *mutex)
339-
{
340-
return find_inlist_lock(&ebt_targets, name, "ebt_", error, mutex);
341-
}
342-
343322
static inline int
344323
ebt_check_match(struct ebt_entry_match *m, struct ebt_entry *e,
345324
const char *name, unsigned int hookmask, unsigned int *cnt)
@@ -1103,87 +1082,6 @@ static int do_replace(void __user *user, unsigned int len)
11031082
return ret;
11041083
}
11051084

1106-
int ebt_register_target(struct ebt_target *target)
1107-
{
1108-
struct ebt_target *t;
1109-
int ret;
1110-
1111-
ret = mutex_lock_interruptible(&ebt_mutex);
1112-
if (ret != 0)
1113-
return ret;
1114-
list_for_each_entry(t, &ebt_targets, list) {
1115-
if (strcmp(t->name, target->name) == 0) {
1116-
mutex_unlock(&ebt_mutex);
1117-
return -EEXIST;
1118-
}
1119-
}
1120-
list_add(&target->list, &ebt_targets);
1121-
mutex_unlock(&ebt_mutex);
1122-
1123-
return 0;
1124-
}
1125-
1126-
void ebt_unregister_target(struct ebt_target *target)
1127-
{
1128-
mutex_lock(&ebt_mutex);
1129-
list_del(&target->list);
1130-
mutex_unlock(&ebt_mutex);
1131-
}
1132-
1133-
int ebt_register_match(struct ebt_match *match)
1134-
{
1135-
struct ebt_match *m;
1136-
int ret;
1137-
1138-
ret = mutex_lock_interruptible(&ebt_mutex);
1139-
if (ret != 0)
1140-
return ret;
1141-
list_for_each_entry(m, &ebt_matches, list) {
1142-
if (strcmp(m->name, match->name) == 0) {
1143-
mutex_unlock(&ebt_mutex);
1144-
return -EEXIST;
1145-
}
1146-
}
1147-
list_add(&match->list, &ebt_matches);
1148-
mutex_unlock(&ebt_mutex);
1149-
1150-
return 0;
1151-
}
1152-
1153-
void ebt_unregister_match(struct ebt_match *match)
1154-
{
1155-
mutex_lock(&ebt_mutex);
1156-
list_del(&match->list);
1157-
mutex_unlock(&ebt_mutex);
1158-
}
1159-
1160-
int ebt_register_watcher(struct ebt_watcher *watcher)
1161-
{
1162-
struct ebt_watcher *w;
1163-
int ret;
1164-
1165-
ret = mutex_lock_interruptible(&ebt_mutex);
1166-
if (ret != 0)
1167-
return ret;
1168-
list_for_each_entry(w, &ebt_watchers, list) {
1169-
if (strcmp(w->name, watcher->name) == 0) {
1170-
mutex_unlock(&ebt_mutex);
1171-
return -EEXIST;
1172-
}
1173-
}
1174-
list_add(&watcher->list, &ebt_watchers);
1175-
mutex_unlock(&ebt_mutex);
1176-
1177-
return 0;
1178-
}
1179-
1180-
void ebt_unregister_watcher(struct ebt_watcher *watcher)
1181-
{
1182-
mutex_lock(&ebt_mutex);
1183-
list_del(&watcher->list);
1184-
mutex_unlock(&ebt_mutex);
1185-
}
1186-
11871085
int ebt_register_table(struct ebt_table *table)
11881086
{
11891087
struct ebt_table_info *newinfo;
@@ -1575,12 +1473,6 @@ static void __exit ebtables_fini(void)
15751473

15761474
EXPORT_SYMBOL(ebt_register_table);
15771475
EXPORT_SYMBOL(ebt_unregister_table);
1578-
EXPORT_SYMBOL(ebt_register_match);
1579-
EXPORT_SYMBOL(ebt_unregister_match);
1580-
EXPORT_SYMBOL(ebt_register_watcher);
1581-
EXPORT_SYMBOL(ebt_unregister_watcher);
1582-
EXPORT_SYMBOL(ebt_register_target);
1583-
EXPORT_SYMBOL(ebt_unregister_target);
15841476
EXPORT_SYMBOL(ebt_do_table);
15851477
module_init(ebtables_init);
15861478
module_exit(ebtables_fini);

0 commit comments

Comments
 (0)