Skip to content

Commit 0ac6ab1

Browse files
Jan Engelhardtkaber
authored andcommitted
netfilter: Change return types of targets/watchers for Ebtables extensions
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
1 parent 8cc784e commit 0ac6ab1

9 files changed

Lines changed: 19 additions & 15 deletions

File tree

‎include/linux/netfilter_bridge/ebtables.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ struct ebt_watcher
221221
{
222222
struct list_head list;
223223
const char name[EBT_FUNCTION_MAXNAMELEN];
224-
void (*watcher)(const struct sk_buff *skb, unsigned int hooknr,
224+
unsigned int (*watcher)(const struct sk_buff *skb, unsigned int hooknr,
225225
const struct net_device *in, const struct net_device *out,
226226
const void *watcherdata, unsigned int datalen);
227227
bool (*check)(const char *tablename, unsigned int hookmask,
@@ -235,8 +235,8 @@ struct ebt_target
235235
{
236236
struct list_head list;
237237
const char name[EBT_FUNCTION_MAXNAMELEN];
238-
/* returns one of the standard verdicts */
239-
int (*target)(struct sk_buff *skb, unsigned int hooknr,
238+
/* returns one of the standard EBT_* verdicts */
239+
unsigned int (*target)(struct sk_buff *skb, unsigned int hooknr,
240240
const struct net_device *in, const struct net_device *out,
241241
const void *targetdata, unsigned int datalen);
242242
bool (*check)(const char *tablename, unsigned int hookmask,

‎net/bridge/netfilter/ebt_arpreply.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/netfilter_bridge/ebtables.h>
1616
#include <linux/netfilter_bridge/ebt_arpreply.h>
1717

18-
static int ebt_target_reply(struct sk_buff *skb, unsigned int hooknr,
18+
static unsigned int ebt_target_reply(struct sk_buff *skb, unsigned int hooknr,
1919
const struct net_device *in, const struct net_device *out,
2020
const void *data, unsigned int datalen)
2121
{

‎net/bridge/netfilter/ebt_dnat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/netfilter_bridge/ebtables.h>
1515
#include <linux/netfilter_bridge/ebt_nat.h>
1616

17-
static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
17+
static unsigned int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
1818
const struct net_device *in, const struct net_device *out,
1919
const void *data, unsigned int datalen)
2020
{

‎net/bridge/netfilter/ebt_log.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum,
192192

193193
}
194194

195-
static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
195+
static unsigned int ebt_log(const struct sk_buff *skb, unsigned int hooknr,
196196
const struct net_device *in, const struct net_device *out,
197197
const void *data, unsigned int datalen)
198198
{
@@ -209,6 +209,7 @@ static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
209209
else
210210
ebt_log_packet(NFPROTO_BRIDGE, hooknr, skb, in, out, &li,
211211
info->prefix);
212+
return EBT_CONTINUE;
212213
}
213214

214215
static struct ebt_watcher log =

‎net/bridge/netfilter/ebt_mark.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <linux/netfilter_bridge/ebtables.h>
1919
#include <linux/netfilter_bridge/ebt_mark_t.h>
2020

21-
static int ebt_target_mark(struct sk_buff *skb, unsigned int hooknr,
21+
static unsigned int ebt_target_mark(struct sk_buff *skb, unsigned int hooknr,
2222
const struct net_device *in, const struct net_device *out,
2323
const void *data, unsigned int datalen)
2424
{

‎net/bridge/netfilter/ebt_nflog.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
#include <linux/netfilter_bridge/ebt_nflog.h>
2020
#include <net/netfilter/nf_log.h>
2121

22-
static void ebt_nflog(const struct sk_buff *skb,
23-
unsigned int hooknr,
24-
const struct net_device *in,
25-
const struct net_device *out,
26-
const void *data, unsigned int datalen)
22+
static unsigned int ebt_nflog(const struct sk_buff *skb,
23+
unsigned int hooknr,
24+
const struct net_device *in,
25+
const struct net_device *out,
26+
const void *data, unsigned int datalen)
2727
{
2828
struct ebt_nflog_info *info = (struct ebt_nflog_info *)data;
2929
struct nf_loginfo li;
@@ -34,6 +34,7 @@ static void ebt_nflog(const struct sk_buff *skb,
3434
li.u.ulog.qthreshold = info->threshold;
3535

3636
nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, "%s", info->prefix);
37+
return EBT_CONTINUE;
3738
}
3839

3940
static bool ebt_nflog_check(const char *tablename,

‎net/bridge/netfilter/ebt_redirect.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#include <linux/netfilter_bridge/ebtables.h>
1616
#include <linux/netfilter_bridge/ebt_redirect.h>
1717

18-
static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr,
18+
static unsigned int ebt_target_redirect(struct sk_buff *skb,
19+
unsigned int hooknr,
1920
const struct net_device *in, const struct net_device *out,
2021
const void *data, unsigned int datalen)
2122
{

‎net/bridge/netfilter/ebt_snat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <linux/netfilter_bridge/ebtables.h>
1717
#include <linux/netfilter_bridge/ebt_nat.h>
1818

19-
static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
19+
static unsigned int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
2020
const struct net_device *in, const struct net_device *out,
2121
const void *data, unsigned int datalen)
2222
{

‎net/bridge/netfilter/ebt_ulog.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,14 @@ static void ebt_log_packet(u_int8_t pf, unsigned int hooknum,
246246
ebt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
247247
}
248248

249-
static void ebt_ulog(const struct sk_buff *skb, unsigned int hooknr,
249+
static unsigned int ebt_ulog(const struct sk_buff *skb, unsigned int hooknr,
250250
const struct net_device *in, const struct net_device *out,
251251
const void *data, unsigned int datalen)
252252
{
253253
const struct ebt_ulog_info *uloginfo = data;
254254

255255
ebt_ulog_packet(hooknr, skb, in, out, uloginfo, NULL);
256+
return EBT_CONTINUE;
256257
}
257258

258259
static bool ebt_ulog_check(const char *tablename, unsigned int hookmask,

0 commit comments

Comments
 (0)