From 8ed17d12ee94aed32464c0cedbd8b94e47fed3ab Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Sun, 2 Mar 2003 15:18:08 +0000 Subject: trivial things --- .../linux2.5/net/bridge/netfilter/ebtable_broute.c | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'kernel/linux2.5/net/bridge/netfilter/ebtable_broute.c') diff --git a/kernel/linux2.5/net/bridge/netfilter/ebtable_broute.c b/kernel/linux2.5/net/bridge/netfilter/ebtable_broute.c index 3a34da1..c1fb15b 100644 --- a/kernel/linux2.5/net/bridge/netfilter/ebtable_broute.c +++ b/kernel/linux2.5/net/bridge/netfilter/ebtable_broute.c @@ -16,15 +16,23 @@ #include #include -// EBT_ACCEPT means the frame will be bridged -// EBT_DROP means the frame will be routed -static struct ebt_entries initial_chain = - {0, "BROUTING", 0, EBT_ACCEPT, 0}; +/* EBT_ACCEPT means the frame will be bridged + * EBT_DROP means the frame will be routed + */ +static struct ebt_entries initial_chain = { + .name = "BROUTING", + .policy = EBT_ACCEPT, +}; static struct ebt_replace initial_table = { - "broute", 1 << NF_BR_BROUTING, 0, sizeof(struct ebt_entries), - { [NF_BR_BROUTING]&initial_chain}, 0, NULL, (char *)&initial_chain + .name = "broute", + .valid_hooks = 1 << NF_BR_BROUTING, + .entries_size = sizeof(struct ebt_entries), + .hook_entry = { + [NF_BR_BROUTING] = &initial_chain + }, + .entries = (char *)&initial_chain }; static int check(const struct ebt_table_info *info, unsigned int valid_hooks) @@ -36,8 +44,11 @@ static int check(const struct ebt_table_info *info, unsigned int valid_hooks) static struct ebt_table broute_table = { - {NULL, NULL}, "broute", &initial_table, 1 << NF_BR_BROUTING, - RW_LOCK_UNLOCKED, check, NULL + .name = "broute", + .table = &initial_table, + .valid_hooks = 1 << NF_BR_BROUTING, + .lock = RW_LOCK_UNLOCKED, + .check = check, }; static int ebt_broute(struct sk_buff **pskb) @@ -47,8 +58,8 @@ static int ebt_broute(struct sk_buff **pskb) ret = ebt_do_table(NF_BR_BROUTING, pskb, (*pskb)->dev, NULL, &broute_table); if (ret == NF_DROP) - return 1; // route it - return 0; // bridge it + return 1; /* route it */ + return 0; /* bridge it */ } static int __init init(void) @@ -59,7 +70,7 @@ static int __init init(void) if (ret < 0) return ret; br_write_lock_bh(BR_NETPROTO_LOCK); - // see br_input.c + /* see br_input.c */ br_should_route_hook = ebt_broute; br_write_unlock_bh(BR_NETPROTO_LOCK); return ret; -- cgit v1.2.3